# 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 IReadOnlyList<Migration>, out IReadOnlyList<Migration>, out Migration)
  Migrator.GenerateScript(string, string, MigrationsSqlGenerationOptions)
  Migrator.GenerateUpSql(Migration, MigrationsSqlGenerationOptions)
  Migrator.GenerateDownSql(Migration, Migration, MigrationsSqlGenerationOptions)
  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)

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)

#### 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

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

#### Parameters

`targetMigration` string
`cancellationToken` CancellationToken

#### Returns

Task