Пример #1
0
        private void From5To6()
        {
            // We now uses the user_version pragma instead of a table to store the db version
            App.db.DropTable("version");

            // Link series and genres
            App.db.CreateTable(@"`serie_genre` (
					`serie_id` INTEGER NOT NULL,
					`genre_id` INTEGER NOT NULL
				);
			"            );

            // Add genres to series
            Repository.Genre genreRepo = Repository.Genre.Instance;
            genreRepo.CreateTable(new Entity.Genre());
            App.db.AddColumn("serie", "genre_id", "INTEGER");

            // Add studio to seasons
            Repository.Studio studioRepo = Repository.Studio.Instance;
            studioRepo.CreateTable(new Entity.Studio());
            App.db.AddColumn("season", "studio_id", "INTEGER");

            // Add premiered season and year to seasons
            App.db.AddColumn("season", "seasonal", "VARCHAR(255)");
            App.db.AddColumn("season", "year", "INTEGER");
        }
Пример #2
0
        /// <summary>
        /// Get instance using this function, do no use a new statment.
        /// </summary>
        /// <returns></returns>
        public static Repository.Genre GetInstance()
        {
            // Prevent threading problems
            lock (locker) {
                if (instance == null)
                {
                    instance = new Repository.Genre();
                }

                return(instance);
            }
        }