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.
public class Migrator : IMigrator
- Inheritance
-
Migrator
- Implements
- Inherited Members
Constructors
Migrator(IMigrationsAssembly, IHistoryRepository, IDatabaseCreator, IMigrationsSqlGenerator, IRawSqlCommandBuilder, IMigrationCommandExecutor, IRelationalConnection, ISqlGenerationHelper, ICurrentDbContext, IModelRuntimeInitializer, IDiagnosticsLogger<Migrations>, IRelationalCommandDiagnosticsLogger, 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, IModelRuntimeInitializer modelRuntimeInitializer, IDiagnosticsLogger<DbLoggerCategory.Migrations> logger, IRelationalCommandDiagnosticsLogger commandLogger, IDatabaseProvider databaseProvider)
Parameters
migrationsAssemblyIMigrationsAssemblyhistoryRepositoryIHistoryRepositorydatabaseCreatorIDatabaseCreatormigrationsSqlGeneratorIMigrationsSqlGeneratorrawSqlCommandBuilderIRawSqlCommandBuildermigrationCommandExecutorIMigrationCommandExecutorconnectionIRelationalConnectionsqlGenerationHelperISqlGenerationHelpercurrentContextICurrentDbContextmodelRuntimeInitializerIModelRuntimeInitializerloggerIDiagnosticsLogger<Migrations>commandLoggerIRelationalCommandDiagnosticsLoggerdatabaseProviderIDatabaseProvider
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