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
migrationsAssembly
IMigrationsAssemblyhistoryRepository
IHistoryRepositorydatabaseCreator
IDatabaseCreatormigrationsSqlGenerator
IMigrationsSqlGeneratorrawSqlCommandBuilder
IRawSqlCommandBuildermigrationCommandExecutor
IMigrationCommandExecutorconnection
IRelationalConnectionsqlGenerationHelper
ISqlGenerationHelpercurrentContext
ICurrentDbContextmodelRuntimeInitializer
IModelRuntimeInitializerlogger
IDiagnosticsLogger<Migrations>commandLogger
IRelationalCommandDiagnosticsLoggerdatabaseProvider
IDatabaseProvider
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
migration
MigrationpreviousMigration
Migrationoptions
MigrationsSqlGenerationOptions
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
fromMigration
stringtoMigration
stringoptions
MigrationsSqlGenerationOptions
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
migration
Migrationoptions
MigrationsSqlGenerationOptions
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
targetMigration
string
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
targetMigration
stringcancellationToken
CancellationToken
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
appliedMigrationEntries
IEnumerable<string>targetMigration
stringmigrationsToApply
IReadOnlyList<Migration>migrationsToRevert
IReadOnlyList<Migration>actualTargetMigration
Migration