@@ -36,10 +36,13 @@ public NpgsqlMigrator(
3636 IModelRuntimeInitializer modelRuntimeInitializer ,
3737 IDiagnosticsLogger < DbLoggerCategory . Migrations > logger ,
3838 IRelationalCommandDiagnosticsLogger commandLogger ,
39- IDatabaseProvider databaseProvider )
39+ IDatabaseProvider databaseProvider ,
40+ IMigrationsModelDiffer migrationsModelDiffer ,
41+ IDesignTimeModel designTimeModel ,
42+ IDbContextOptions contextOptions )
4043 : base ( migrationsAssembly , historyRepository , databaseCreator , migrationsSqlGenerator , rawSqlCommandBuilder ,
4144 migrationCommandExecutor , connection , sqlGenerationHelper , currentContext , modelRuntimeInitializer , logger ,
42- commandLogger , databaseProvider )
45+ commandLogger , databaseProvider , migrationsModelDiffer , designTimeModel , contextOptions )
4346 {
4447 _historyRepository = historyRepository ;
4548 _connection = connection ;
@@ -51,7 +54,7 @@ public NpgsqlMigrator(
5154 /// any release. You should only use it directly in your code with extreme caution and knowing that
5255 /// doing so can result in application failures when updating to a new Entity Framework Core release.
5356 /// </summary>
54- public override void Migrate ( string ? targetMigration = null )
57+ public override void Migrate ( string ? targetMigration )
5558 {
5659 var appliedMigrations = _historyRepository . GetAppliedMigrations ( ) ;
5760
@@ -60,17 +63,15 @@ public override void Migrate(string? targetMigration = null)
6063 PopulateMigrations (
6164 appliedMigrations . Select ( t => t . MigrationId ) ,
6265 targetMigration ,
63- out var migrationsToApply ,
64- out var migrationsToRevert ,
65- out _ ) ;
66+ out var migratorData ) ;
6667
67- if ( migrationsToRevert . Count + migrationsToApply . Count == 0 )
68+ if ( migratorData . RevertedMigrations . Count + migratorData . AppliedMigrations . Count == 0 )
6869 {
6970 return ;
7071 }
7172
7273 // If a PostgreSQL extension, enum or range was added, we want Npgsql to reload all types at the ADO.NET level.
73- var migrations = migrationsToApply . Count > 0 ? migrationsToApply : migrationsToRevert ;
74+ var migrations = migratorData . AppliedMigrations . Count > 0 ? migratorData . AppliedMigrations : migratorData . RevertedMigrations ;
7475 var reloadTypes = migrations
7576 . SelectMany ( m => m . UpOperations )
7677 . OfType < AlterDatabaseOperation > ( )
@@ -96,9 +97,7 @@ public override void Migrate(string? targetMigration = null)
9697 /// any release. You should only use it directly in your code with extreme caution and knowing that
9798 /// doing so can result in application failures when updating to a new Entity Framework Core release.
9899 /// </summary>
99- public override async Task MigrateAsync (
100- string ? targetMigration = null ,
101- CancellationToken cancellationToken = default )
100+ public override async Task MigrateAsync ( string ? targetMigration , CancellationToken cancellationToken = default )
102101 {
103102 var appliedMigrations = await _historyRepository . GetAppliedMigrationsAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
104103
@@ -107,17 +106,15 @@ public override async Task MigrateAsync(
107106 PopulateMigrations (
108107 appliedMigrations . Select ( t => t . MigrationId ) ,
109108 targetMigration ,
110- out var migrationsToApply ,
111- out var migrationsToRevert ,
112- out _ ) ;
109+ out var migratorData ) ;
113110
114- if ( migrationsToRevert . Count + migrationsToApply . Count == 0 )
111+ if ( migratorData . RevertedMigrations . Count + migratorData . AppliedMigrations . Count == 0 )
115112 {
116113 return ;
117114 }
118115
119116 // If a PostgreSQL extension, enum or range was added, we want Npgsql to reload all types at the ADO.NET level.
120- var migrations = migrationsToApply . Count > 0 ? migrationsToApply : migrationsToRevert ;
117+ var migrations = migratorData . AppliedMigrations . Count > 0 ? migratorData . AppliedMigrations : migratorData . RevertedMigrations ;
121118 var reloadTypes = migrations
122119 . SelectMany ( m => m . UpOperations )
123120 . OfType < AlterDatabaseOperation > ( )
0 commit comments