/// <summary> /// /// </summary> protected virtual void InternalMigrate() { var codeTables = CodeTablesManager.GetTableInfos(); var databaseTables = DatabaseTablesManager.GetTableInfos(); DatabaseCommandManager.MergeTables(codeTables, databaseTables); DatabaseCommandManager.Migrate(); }
/// <summary> /// /// </summary> /// <returns></returns> public void InitializePrimaryKeys() { MySqlPrimaryKeys = new List <MySqlPrimaryKey>(); var commandText = string.Format(Scripts.SelectPrimaryKeys, DatabaseTablesManager.GetDatabaseName()); var command = GetMySqlCommand(commandText); var reader = command.ExecuteReader(); if (!reader.HasRows) { return; } while (reader.Read()) { MySqlPrimaryKeys.Add(ReaderToPrimaryKey(reader)); } }
/// <summary> /// /// </summary> public void InitializeTables() { MySqlTables = new List <MySqlTable>(); var dbName = DatabaseTablesManager.GetDatabaseName(); var commandText = string.Format(Scripts.SelectTables, dbName); var command = GetMySqlCommand(commandText); var reader = command.ExecuteReader(); if (!reader.HasRows) { return; } while (reader.Read()) { MySqlTables.Add(new MySqlTable(reader["TABLE_SCHEMA"] as string, reader["TABLE_NAME"] as string)); } const string name = MigrationsHistoryRepositoryHelper.HistoryTable; MySqlTables.RemoveAll(r => r.Name == name && r.Schema == dbName); }
/// <summary> /// /// </summary> protected virtual void InitializeManagers() { CodeTablesManager.Initialize(); DatabaseTablesManager.Initialize(); DatabaseCommandManager.Initialize(); }