Example #1
0
 public MySqlMigrator(
     [NotNull] IMigrationsAssembly migrationsAssembly,
     [NotNull] IHistoryRepository historyRepository,
     [NotNull] IDatabaseCreator databaseCreator,
     [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
     [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
     [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
     [NotNull] IRelationalConnection connection,
     [NotNull] ISqlGenerationHelper sqlGenerationHelper,
     [NotNull] ICurrentDbContext currentContext,
     [NotNull] IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
     [NotNull] IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger,
     [NotNull] IDatabaseProvider databaseProvider)
     : base(
         migrationsAssembly,
         historyRepository,
         databaseCreator,
         migrationsSqlGenerator,
         rawSqlCommandBuilder,
         migrationCommandExecutor,
         connection,
         sqlGenerationHelper,
         currentContext,
         logger,
         commandLogger,
         databaseProvider)
 {
     _migrationsAssembly   = migrationsAssembly;
     _rawSqlCommandBuilder = rawSqlCommandBuilder;
     _currentContext       = currentContext;
     _commandLogger        = commandLogger;
 }
Example #2
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public Migrator(
     IMigrationsAssembly migrationsAssembly,
     IHistoryRepository historyRepository,
     IDatabaseCreator databaseCreator,
     IMigrationsSqlGenerator migrationsSqlGenerator,
     IRawSqlCommandBuilder rawSqlCommandBuilder,
     IMigrationCommandExecutor migrationCommandExecutor,
     IRelationalConnection connection,
     ISqlGenerationHelper sqlGenerationHelper,
     ICurrentDbContext currentContext,
     IModelRuntimeInitializer modelRuntimeInitializer,
     IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
     IRelationalCommandDiagnosticsLogger commandLogger,
     IDatabaseProvider databaseProvider)
 {
     _migrationsAssembly       = migrationsAssembly;
     _historyRepository        = historyRepository;
     _databaseCreator          = (IRelationalDatabaseCreator)databaseCreator;
     _migrationsSqlGenerator   = migrationsSqlGenerator;
     _rawSqlCommandBuilder     = rawSqlCommandBuilder;
     _migrationCommandExecutor = migrationCommandExecutor;
     _connection              = connection;
     _sqlGenerationHelper     = sqlGenerationHelper;
     _currentContext          = currentContext;
     _modelRuntimeInitializer = modelRuntimeInitializer;
     _logger         = logger;
     _commandLogger  = commandLogger;
     _activeProvider = databaseProvider.Name;
 }
Example #3
0
        /// <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 Migrator(
            [NotNull] IMigrationsAssembly migrationsAssembly,
            [NotNull] IHistoryRepository historyRepository,
            [NotNull] IDatabaseCreator databaseCreator,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IRelationalConnection connection,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] IInterceptingLogger <LoggerCategory.Migrations> logger,
            [NotNull] IDatabaseProvider databaseProvider)
        {
            Check.NotNull(migrationsAssembly, nameof(migrationsAssembly));
            Check.NotNull(historyRepository, nameof(historyRepository));
            Check.NotNull(databaseCreator, nameof(databaseCreator));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(databaseProvider, nameof(databaseProvider));

            _migrationsAssembly       = migrationsAssembly;
            _historyRepository        = historyRepository;
            _databaseCreator          = (IRelationalDatabaseCreator)databaseCreator;
            _migrationsSqlGenerator   = migrationsSqlGenerator;
            _rawSqlCommandBuilder     = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
            _connection          = connection;
            _sqlGenerationHelper = sqlGenerationHelper;
            _logger         = logger;
            _activeProvider = databaseProvider.InvariantName;
        }
Example #4
0
        public RelationalDatabaseCreatorDependencies(
            [NotNull] IModel model,
            [NotNull] IRelationalConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] IExecutionStrategyFactory executionStrategyFactory,
            [NotNull] IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(modelDiffer, nameof(modelDiffer));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(executionStrategyFactory, nameof(executionStrategyFactory));
            Check.NotNull(commandLogger, nameof(commandLogger));

            Model                    = model;
            Connection               = connection;
            ModelDiffer              = modelDiffer;
            MigrationsSqlGenerator   = migrationsSqlGenerator;
            MigrationCommandExecutor = migrationCommandExecutor;
            SqlGenerationHelper      = sqlGenerationHelper;
            ExecutionStrategyFactory = executionStrategyFactory;
            CommandLogger            = commandLogger;
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PluginMigrator"/> class.
 /// </summary>
 /// <param name="migrationsSqlGenerator">The migrations SQL generator.</param>
 /// <param name="migrationsAssembly">The migrations assembly.</param>
 /// <param name="pluginHistoryRepository">The plugin history repository.</param>
 /// <param name="rawSqlCommandBuilder">The raw SQL command builder.</param>
 /// <param name="migrationCommandExecutor">The migration command executor.</param>
 /// <param name="connection">The connection.</param>
 /// <param name="sqlGenerationHelper">The SQL generation helper.</param>
 /// <param name="currentContext">The current context.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="commandLogger">The command logger.</param>
 /// <param name="databaseProvider">The database provider.</param>
 public PluginMigrator(
     IMigrationsSqlGenerator migrationsSqlGenerator,
     IMigrationsAssembly migrationsAssembly,
     IPluginHistoryRepository pluginHistoryRepository,
     IRawSqlCommandBuilder rawSqlCommandBuilder,
     IMigrationCommandExecutor migrationCommandExecutor,
     IRelationalConnection connection,
     ISqlGenerationHelper sqlGenerationHelper,
     ICurrentDbContext currentContext,
     ILoggerFactory loggerFactory,
     IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger,
     IDatabaseProvider databaseProvider)
 {
     MigrationsSqlGenerator   = migrationsSqlGenerator;
     MigrationsAssembly       = migrationsAssembly;
     PluginHistoryRepository  = pluginHistoryRepository;
     RawSqlCommandBuilder     = rawSqlCommandBuilder;
     MigrationCommandExecutor = migrationCommandExecutor;
     Connection          = connection;
     SqlGenerationHelper = sqlGenerationHelper;
     CurrentContext      = currentContext;
     Logger           = loggerFactory.CreateLogger("BlueBoxMoon.Data.EntityFramework.Migrations.PluginMigrator");
     CommandLogger    = commandLogger;
     DatabaseProvider = databaseProvider;
 }
Example #6
0
        /// <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 Migrator(
            [NotNull] IMigrationsAssembly migrationsAssembly,
            [NotNull] IHistoryRepository historyRepository,
            [NotNull] IDatabaseCreator databaseCreator,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IRelationalConnection connection,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] ILogger<Migrator> logger,
            [NotNull] IDatabaseProviderServices providerServices)
        {
            Check.NotNull(migrationsAssembly, nameof(migrationsAssembly));
            Check.NotNull(historyRepository, nameof(historyRepository));
            Check.NotNull(databaseCreator, nameof(databaseCreator));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(providerServices, nameof(providerServices));

            _migrationsAssembly = migrationsAssembly;
            _historyRepository = historyRepository;
            _databaseCreator = (IRelationalDatabaseCreator)databaseCreator;
            _migrationsSqlGenerator = migrationsSqlGenerator;
            _rawSqlCommandBuilder = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
            _connection = connection;
            _sqlGenerationHelper = sqlGenerationHelper;
            _logger = logger;
            _activeProvider = providerServices.InvariantName;
        }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="migrationCommandExecutor"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public RelationalDatabaseCreatorDependencies With([NotNull] IMigrationCommandExecutor migrationCommandExecutor)
 => new RelationalDatabaseCreatorDependencies(
     Model,
     Connection,
     ModelDiffer,
     MigrationsSqlGenerator,
     migrationCommandExecutor,
     ExecutionStrategyFactory);
 public MyRelationalDatabaseCreator(
     IModel model,
     IRelationalConnection connection,
     IMigrationsModelDiffer modelDiffer,
     IMigrationsSqlGenerator migrationsSqlGenerator,
     IMigrationCommandExecutor migrationCommandExecutor)
     : base(model, connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor)
 {
 }
 public MySQLDatabaseCreator(
     [NotNull] RelationalDatabaseCreatorDependencies dependencies,
     [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(dependencies)
 {
     _connection               = (MySQLServerConnection)dependencies.Connection;
     _sqlGenerator             = dependencies.MigrationsSqlGenerator;
     _rawSqlCommandBuilder     = rawSqlCommandBuilder;
     _migrationCommandExecutor = dependencies.MigrationCommandExecutor;
 }
 public TestDatabaseCreator(
     ISqlServerConnection connection,
     IMigrationsModelDiffer modelDiffer,
     IMigrationsSqlGenerator sqlGenerator,
     IMigrationCommandExecutor migrationCommandExecutor,
     IModel model,
     IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(connection, modelDiffer, sqlGenerator, migrationCommandExecutor, model, rawSqlCommandBuilder)
 {
 }
 public TestDatabaseCreator(
     NpgsqlRelationalConnection connection,
     IMigrationsModelDiffer modelDiffer,
     IMigrationsSqlGenerator sqlGenerator,
     IMigrationCommandExecutor migrationCommandExecutor,
     IModel model,
     IRawSqlCommandBuilder rawSqlCommandBuilder,
     IExecutionStrategyFactory executionStrategyFactory)
     : base(connection, modelDiffer, sqlGenerator, migrationCommandExecutor, model, rawSqlCommandBuilder, executionStrategyFactory)
 {
 }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="migrationCommandExecutor"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public RelationalDatabaseCreatorDependencies With([NotNull] IMigrationCommandExecutor migrationCommandExecutor)
 => new RelationalDatabaseCreatorDependencies(
     Model,
     Connection,
     ModelDiffer,
     MigrationsSqlGenerator,
     migrationCommandExecutor,
     SqlGenerationHelper,
     ExecutionStrategyFactory,
     CurrentDbContext,
     CommandLogger);
        /// <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 SqliteDatabaseCreator(
            [NotNull] SqliteRelationalConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IModel model,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder)
            : base(model, connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor)
        {
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));

            _connection           = connection;
            _rawSqlCommandBuilder = rawSqlCommandBuilder;
        }
Example #14
0
 public TemporalTableMigrator(
     IMigrationsAssembly migrationsAssembly,
     IHistoryRepository historyRepository,
     IDatabaseCreator databaseCreator,
     IMigrationsSqlGenerator migrationsSqlGenerator,
     IRawSqlCommandBuilder rawSqlCommandBuilder,
     IMigrationCommandExecutor migrationCommandExecutor,
     IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper,
     IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
     IDatabaseProvider databaseProvider,
     ITemporalTableSqlExecutor <TContext> temporalTableSqlExecutor)
     : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, logger, databaseProvider)
 {
     this.temporalTableSqlExecutor = temporalTableSqlExecutor;
 }
        /// <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 SqlServerDatabaseCreator(
            [NotNull] ISqlServerConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IModel model,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IExecutionStrategyFactory executionStrategyFactory)
            : base(model, connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor, executionStrategyFactory)
        {
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));

            _connection             = connection;
            _migrationsSqlGenerator = migrationsSqlGenerator;
            _rawSqlCommandBuilder   = rawSqlCommandBuilder;
        }
Example #16
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        public Migrator(
            [NotNull] IMigrationsAssembly migrationsAssembly,
            [NotNull] IHistoryRepository historyRepository,
            [NotNull] IDatabaseCreator databaseCreator,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IRelationalConnection connection,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] ICurrentDbContext currentContext,
            [NotNull] IConventionSetBuilder conventionSetBuilder,
            [NotNull] IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
            [NotNull] IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger,
            [NotNull] IDatabaseProvider databaseProvider)
        {
            Check.NotNull(migrationsAssembly, nameof(migrationsAssembly));
            Check.NotNull(historyRepository, nameof(historyRepository));
            Check.NotNull(databaseCreator, nameof(databaseCreator));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(currentContext, nameof(currentContext));
            Check.NotNull(conventionSetBuilder, nameof(conventionSetBuilder));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(commandLogger, nameof(commandLogger));
            Check.NotNull(databaseProvider, nameof(databaseProvider));

            _migrationsAssembly       = migrationsAssembly;
            _historyRepository        = historyRepository;
            _databaseCreator          = (IRelationalDatabaseCreator)databaseCreator;
            _migrationsSqlGenerator   = migrationsSqlGenerator;
            _rawSqlCommandBuilder     = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
            _connection           = connection;
            _sqlGenerationHelper  = sqlGenerationHelper;
            _currentContext       = currentContext;
            _conventionSetBuilder = conventionSetBuilder;
            _logger         = logger;
            _commandLogger  = commandLogger;
            _activeProvider = databaseProvider.Name;
        }
Example #17
0
        protected RelationalDatabaseCreator(
            [NotNull] IModel model,
            [NotNull] IRelationalConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(modelDiffer, nameof(modelDiffer));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));

            Model                    = model;
            Connection               = connection;
            _modelDiffer             = modelDiffer;
            _migrationsSqlGenerator  = migrationsSqlGenerator;
            MigrationCommandExecutor = migrationCommandExecutor;
        }
Example #18
0
        public MySQLDatabaseCreator(
            MySQLRelationalConnection cxn,
            IMigrationsModelDiffer differ,
            IMigrationsSqlGenerator generator,
            IMigrationCommandExecutor executor,
            IModel model,
            IRawSqlCommandBuilder commandBuilder)
            : base(model, cxn, differ, generator, executor)
        {
            ThrowIf.Argument.IsNull(cxn, "connection");
            ThrowIf.Argument.IsNull(differ, "modelDiffer");
            ThrowIf.Argument.IsNull(generator, "generator");
            ThrowIf.Argument.IsNull(commandBuilder, "commandBuilder");

            _connection      = cxn;
            _sqlGenerator    = generator;
            _commandExecutor = executor;
            _commandBuilder  = commandBuilder;
        }
Example #19
0
 public TemporalTableMigrator(
     IMigrationsAssembly migrationsAssembly,
     IHistoryRepository historyRepository,
     IDatabaseCreator databaseCreator,
     IEnumerable <IMigrationsSqlGenerator> migrationsSqlGenerators,
     IRawSqlCommandBuilder rawSqlCommandBuilder,
     IMigrationCommandExecutor migrationCommandExecutor,
     IRelationalConnection connection,
     ISqlGenerationHelper sqlGenerationHelper,
     ICurrentDbContext currentDbContext,
     IConventionSetBuilder conventionSetBuilder,
     IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
     IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger,
     IDatabaseProvider databaseProvider,
     ITemporalTableSqlExecutor <TContext> temporalTableSqlExecutor)
     : base(migrationsAssembly, historyRepository, databaseCreator, resolveMigrationsSqlGenerator(migrationsSqlGenerators), rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, currentDbContext, conventionSetBuilder, logger, commandLogger, databaseProvider)
 {
     this.temporalTableSqlExecutor = temporalTableSqlExecutor;
 }
Example #20
0
        /// <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);
        }
Example #21
0
        public MySQLDatabaseCreator(
            [NotNull] MySQLServerConnection cxn,
            [NotNull] IMigrationsModelDiffer differ,
            [NotNull] IMigrationsSqlGenerator generator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IModel model,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IExecutionStrategyFactory executionStrategyFactory)
            : base(model, cxn, differ, generator, migrationCommandExecutor, executionStrategyFactory)
        {
            ThrowIf.Argument.IsNull(cxn, "connection");
            ThrowIf.Argument.IsNull(differ, "modelDiffer");
            ThrowIf.Argument.IsNull(generator, "generator");
            ThrowIf.Argument.IsNull(rawSqlCommandBuilder, "commandBuilder");

            _connection               = cxn;
            _sqlGenerator             = generator;
            _rawSqlCommandBuilder     = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
        }
Example #22
0
        /// <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 MyCatMigrator(
            [NotNull] IMigrationsAssembly migrationsAssembly,
            [NotNull] IHistoryRepository historyRepository,
            [NotNull] IDatabaseCreator databaseCreator,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IRelationalConnection connection,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] ILogger <Migrator> logger,
            [NotNull] IDatabaseProviderServices providerServices,
            [NotNull] IDbContextOptions options,
            [NotNull] MyCatSchemaGenerator schemaCreator)
            : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, logger, providerServices)
        {
            Check.NotNull(migrationsAssembly, nameof(migrationsAssembly));
            Check.NotNull(historyRepository, nameof(historyRepository));
            Check.NotNull(databaseCreator, nameof(databaseCreator));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(providerServices, nameof(providerServices));

            _migrationsAssembly       = migrationsAssembly;
            _historyRepository        = (MyCatHistoryRepository)historyRepository;
            _databaseCreator          = (MyCatDatabaseCreator)databaseCreator;
            _migrationsSqlGenerator   = migrationsSqlGenerator;
            _rawSqlCommandBuilder     = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
            _connection          = (MyCatRelationalConnection)connection;
            _sqlGenerationHelper = sqlGenerationHelper;
            _logger         = logger;
            _activeProvider = providerServices.InvariantName;
            _options        = options;
            _schemaCreator  = schemaCreator;
        }
Example #23
0
        /// <summary>
        ///     <para>
        ///         Creates the service dependencies parameter object for a <see cref="RelationalDatabaseCreator" />.
        ///     </para>
        ///     <para>
        ///         Do not call this constructor directly from either provider or application code as it may change
        ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
        ///         will be created and injected automatically by the dependency injection container. To create
        ///         an instance with some dependent services replaced, first resolve the object from the dependency
        ///         injection container, then replace selected services using the 'With...' methods. Do not call
        ///         the constructor at any point in this process.
        ///     </para>
        ///     <para>
        ///         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.
        ///     </para>
        /// </summary>
        /// <param name="model"> The <see cref="IModel" /> for the context this creator is being used with. </param>
        /// <param name="connection"> The <see cref="IRelationalConnection" /> to be used. </param>
        /// <param name="modelDiffer"> The <see cref="IMigrationsModelDiffer" /> to be used. </param>
        /// <param name="migrationsSqlGenerator"> The <see cref="IMigrationsSqlGenerator" /> to be used. </param>
        /// <param name="migrationCommandExecutor"> The <see cref="IMigrationCommandExecutor" /> to be used. </param>
        /// <param name="executionStrategyFactory">The <see cref="IExecutionStrategyFactory" /> to be used. </param>
        public RelationalDatabaseCreatorDependencies(
            [NotNull] IModel model,
            [NotNull] IRelationalConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IExecutionStrategyFactory executionStrategyFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(modelDiffer, nameof(modelDiffer));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(executionStrategyFactory, nameof(executionStrategyFactory));

            Model                    = model;
            Connection               = connection;
            ModelDiffer              = modelDiffer;
            MigrationsSqlGenerator   = migrationsSqlGenerator;
            MigrationCommandExecutor = migrationCommandExecutor;
            ExecutionStrategyFactory = executionStrategyFactory;
        }
 public TestDatabaseCreator(
     ISqlServerConnection connection,
     IMigrationsModelDiffer modelDiffer,
     IMigrationsSqlGenerator sqlGenerator,
     IMigrationCommandExecutor migrationCommandExecutor,
     IModel model,
     IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(connection, modelDiffer, sqlGenerator, migrationCommandExecutor, model, rawSqlCommandBuilder)
 {
 }
Example #25
0
 public SqlDbCreator(ISqlServerConnection connection, IMigrationsModelDiffer modelDiffer, IMigrationsSqlGenerator migrationsSqlGenerator, IMigrationCommandExecutor migrationCommandExecutor, IModel model, IRawSqlCommandBuilder rawSqlCommandBuilder, IExecutionStrategyFactory sqlExecutionStrategyFactory) : base(connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor, model, rawSqlCommandBuilder, sqlExecutionStrategyFactory)
 {
     this._connection = connection;
 }
Example #26
0
 public IgnoreForeignKeyMySqlMigrator(IMigrationsAssembly migrationsAssembly,
                                      IHistoryRepository historyRepository,
                                      IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator,
                                      IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor,
                                      IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper,
                                      ICurrentDbContext currentContext, IDiagnosticsLogger <DbLoggerCategory.Migrations> logger,
                                      IDiagnosticsLogger <DbLoggerCategory.Database.Command> commandLogger, IDatabaseProvider databaseProvider) :
     base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder,
          migrationCommandExecutor, connection, sqlGenerationHelper, currentContext, logger, commandLogger,
          databaseProvider)
 {
 }