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(); }
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(); }
public static void UpdateDatabaseToLatestVersion() { DatabaseManager.IsDatabaseUpdating = true; var migrator = new mobSocialDbMigrator(new Configuration()); if (migrator.GetPendingMigrations().Any()) { migrator.Update(); } DatabaseManager.IsDatabaseUpdating = false; }
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(); }