Class Migrator
- Namespace
- Microsoft.EntityFrameworkCore.Migrations.Internal
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
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.
The service lifetime is Scoped. This means that each Microsoft.EntityFrameworkCore.DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.
public class Migrator : IMigrator
- Inheritance
-
Migrator
- Implements
- Inherited Members
Constructors
Migrator(IMigrationsAssembly, IHistoryRepository, IDatabaseCreator, IMigrationsSqlGenerator, IRawSqlCommandBuilder, IMigrationCommandExecutor, IRelationalConnection, ISqlGenerationHelper, ICurrentDbContext, IConventionSetBuilder, IDiagnosticsLogger<Migrations>, IDiagnosticsLogger<Command>, IDatabaseProvider)
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.
public Migrator(IMigrationsAssembly migrationsAssembly, IHistoryRepository historyRepository, IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator, IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor, IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper, ICurrentDbContext currentContext, IConventionSetBuilder conventionSetBuilder, IDiagnosticsLogger<DbLoggerCategory.Migrations> logger, IDiagnosticsLogger<DbLoggerCategory.Database.Command> commandLogger, IDatabaseProvider databaseProvider)
Parameters
migrationsAssemblyIMigrationsAssemblyhistoryRepositoryIHistoryRepositorydatabaseCreatorIDatabaseCreatormigrationsSqlGeneratorIMigrationsSqlGeneratorrawSqlCommandBuilderIRawSqlCommandBuildermigrationCommandExecutorIMigrationCommandExecutorconnectionIRelationalConnectionsqlGenerationHelperISqlGenerationHelpercurrentContextICurrentDbContextconventionSetBuilderIConventionSetBuilderloggerIDiagnosticsLogger<Migrations>commandLoggerIDiagnosticsLogger<Command>databaseProviderIDatabaseProvider
Methods
GenerateDownSql(Migration, Migration, MigrationsSqlGenerationOptions)
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.
protected virtual IReadOnlyList<MigrationCommand> GenerateDownSql(Migration migration, Migration previousMigration, MigrationsSqlGenerationOptions options = MigrationsSqlGenerationOptions.Default)
Parameters
migrationMigrationpreviousMigrationMigrationoptionsMigrationsSqlGenerationOptions
Returns
GenerateScript(string, string, MigrationsSqlGenerationOptions)
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.
public virtual string GenerateScript(string fromMigration = null, string toMigration = null, MigrationsSqlGenerationOptions options = MigrationsSqlGenerationOptions.Default)
Parameters
fromMigrationstringtoMigrationstringoptionsMigrationsSqlGenerationOptions
Returns
GenerateUpSql(Migration, MigrationsSqlGenerationOptions)
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.
protected virtual IReadOnlyList<MigrationCommand> GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options = MigrationsSqlGenerationOptions.Default)
Parameters
migrationMigrationoptionsMigrationsSqlGenerationOptions
Returns
Migrate(string)
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.
public virtual void Migrate(string targetMigration = null)
Parameters
targetMigrationstring
MigrateAsync(string, CancellationToken)
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.
public virtual Task MigrateAsync(string targetMigration = null, CancellationToken cancellationToken = default)
Parameters
targetMigrationstringcancellationTokenCancellationToken
Returns
PopulateMigrations(IEnumerable<string>, string, out IReadOnlyList<Migration>, out IReadOnlyList<Migration>, out Migration)
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.
protected virtual void PopulateMigrations(IEnumerable<string> appliedMigrationEntries, string targetMigration, out IReadOnlyList<Migration> migrationsToApply, out IReadOnlyList<Migration> migrationsToRevert, out Migration actualTargetMigration)
Parameters
appliedMigrationEntriesIEnumerable<string>targetMigrationstringmigrationsToApplyIReadOnlyList<Migration>migrationsToRevertIReadOnlyList<Migration>actualTargetMigrationMigration