/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public override void Migrate(string targetMigration = null) { // Get data node connections var ext = _options.FindExtension <MyCatOptionsExtension>(); _schemaCreator.CommitSchema(_connection); foreach (var x in ext.DataNodes) { Migrate(x.Master, targetMigration); if (x.Slave != null) { Migrate(x.Slave, targetMigration); } } }
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public MyCatDatabaseCreator( [NotNull] MyCatRelationalConnection connection, [NotNull] IMigrationsModelDiffer modelDiffer, [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator, [NotNull] IMigrationCommandExecutor migrationCommandExecutor, [NotNull] IModel model, [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder, [NotNull] IDbContextOptions options, [NotNull] MyCatSchemaGenerator schemaGenerator) : base(model, connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor) { Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder)); _connection = connection; _migrationsSqlGenerator = migrationsSqlGenerator; _rawSqlCommandBuilder = rawSqlCommandBuilder; _options = options; _schemaGenerator = schemaGenerator; _schemaGenerator.CommitSchema(_connection); }