public MigrationHealthCheck(IDatabase db) { _db = db; var assembly = Assembly.GetAssembly(typeof(DbUpMigrator)); Debug.Assert(assembly != null); _migrationScripts = assembly.GetManifestResourceNames() .Where(s => !DbUpMigrator.IsReRunnableMigration(s)) .ToList(); }
private void MigrateDatabase() { var migrator = new DbUpMigrator(Configuration.GetConnectionString("Postgres")); try { migrator.Migrate(); } catch (DbUpMigrationException ex) { Log.Logger.Fatal(ex, "Failed at migrating"); throw; } }