# Class NpgsqlMigrator

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.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 NpgsqlMigrator : Migrator, IMigrator

Inheritance
  object
  Migrator
  NpgsqlMigrator

Implements
  IMigrator

Inherited Members
  Migrator.PopulateMigrations(IEnumerable<string>, string, out MigratorData)
  Migrator.VerifyMigrationSucceeded(string, MigrationExecutionState)
  Migrator.VerifyMigrationSucceededAsync(string, MigrationExecutionState, CancellationToken)
  Migrator.GenerateScript(string, string, MigrationsSqlGenerationOptions)
  Migrator.GenerateUpSql(Migration, MigrationsSqlGenerationOptions)
  Migrator.GenerateDownSql(Migration, Migration, MigrationsSqlGenerationOptions)
  Migrator.HasPendingModelChanges()
  Migrator.MigrationTransactionIsolationLevel
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### NpgsqlMigrator(IMigrationsAssembly, IHistoryRepository, IDatabaseCreator, IMigrationsSqlGenerator, IRawSqlCommandBuilder, IMigrationCommandExecutor, IRelationalConnection, ISqlGenerationHelper, ICurrentDbContext, IModelRuntimeInitializer, IDiagnosticsLogger<Migrations>, IRelationalCommandDiagnosticsLogger, IDatabaseProvider, IMigrationsModelDiffer, IDesignTimeModel, IDbContextOptions, IExecutionStrategy)

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 NpgsqlMigrator(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, IMigrationsModelDiffer migrationsModelDiffer, IDesignTimeModel designTimeModel, IDbContextOptions contextOptions, IExecutionStrategy executionStrategy)

#### Parameters

`migrationsAssembly` IMigrationsAssembly
`historyRepository` IHistoryRepository
`databaseCreator` IDatabaseCreator
`migrationsSqlGenerator` IMigrationsSqlGenerator
`rawSqlCommandBuilder` IRawSqlCommandBuilder
`migrationCommandExecutor` IMigrationCommandExecutor
`connection` IRelationalConnection
`sqlGenerationHelper` ISqlGenerationHelper
`currentContext` ICurrentDbContext
`modelRuntimeInitializer` IModelRuntimeInitializer
`logger` IDiagnosticsLogger<DbLoggerCategory.Migrations>
`commandLogger` IRelationalCommandDiagnosticsLogger
`databaseProvider` IDatabaseProvider
`migrationsModelDiffer` IMigrationsModelDiffer
`designTimeModel` IDesignTimeModel
`contextOptions` IDbContextOptions
`executionStrategy` IExecutionStrategy

## Methods

### 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 override void Migrate(string? targetMigration)

#### 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 override Task MigrateAsync(string? targetMigration, CancellationToken cancellationToken = default)

#### Parameters

`targetMigration` string
`cancellationToken` CancellationToken

#### Returns

Task