public static bool Run() { var dbConnection = new DatabaseConnection(new MySqlConnection(Program.ConnectionString)); var options = new MigratorOptions() { EntitiesExcluded = new List <Type>() { { typeof(Application.Entities.BaseEntity) }, { typeof(Application.Entities.CustomFieldEntity) } } }; var migrator = new Migrator(dbConnection, options); var script = migrator.GetDatabaseUpdateScript(); if (!string.IsNullOrEmpty(script)) { migrator.RunDbUpdate(script); return(true); } return(false); }
public Migrator(IDatabaseConnection dbConnection, MigratorOptions options) { DbConnection = dbConnection; SchemaRepository = new SchemaRepository(dbConnection); Options = options; }