상속: System.Data.Entity.Migrations.DbMigrator
예제 #1
0
        public void Install(string connectionString, string providerName)
        {
            DatabaseManager.SetDbInitializer(new CreateOrUpdateTables<DatabaseContext>());

            //run the migrator to install the database
            var migrator = new mobSocialDbMigrator(new Data.Migrations.Configuration(connectionString, providerName));
            migrator.Update();
        }
예제 #2
0
        public void Install()
        {
            DatabaseManager.SetDbInitializer(new CreateOrUpdateTables<DatabaseContext>());

            //run the migrator to install the database
            var migrator = new mobSocialDbMigrator(new Data.Migrations.Configuration());
            migrator.Update();
        }
예제 #3
0
        public static void UpdateDatabaseToLatestVersion()
        {
            DatabaseManager.IsDatabaseUpdating = true;
            var migrator = new mobSocialDbMigrator(new Configuration());

            if (migrator.GetPendingMigrations().Any())
            {
                migrator.Update();
            }

            DatabaseManager.IsDatabaseUpdating = false;
        }
예제 #4
0
        public void Run()
        {
            if (!DatabaseManager.IsDatabaseInstalled())
                return;

            //set db context to null to avoid any errors
            DatabaseManager.SetDbInitializer<DatabaseContext>(null);

            //run the migrator. this will update any pending tasks or updates to database
            var migrator = new mobSocialDbMigrator(new Data.Migrations.Configuration());
            migrator.Update();
        }