diff --git a/EF6.PG/NpgsqlMigrationSqlGenerator.cs b/EF6.PG/NpgsqlMigrationSqlGenerator.cs index c3f26e0..578e0ed 100644 --- a/EF6.PG/NpgsqlMigrationSqlGenerator.cs +++ b/EF6.PG/NpgsqlMigrationSqlGenerator.cs @@ -81,7 +81,13 @@ protected virtual void Convert([NotNull] IEnumerable operati else if (migrationOperation is RenameColumnOperation renameColumnOperation) Convert(renameColumnOperation); else if (migrationOperation is UpdateDatabaseOperation databaseOperation) - Convert(databaseOperation.Migrations as IEnumerable); + { + if (databaseOperation.Migrations is IEnumerable migrationOperations) + Convert(migrationOperations); + if (databaseOperation.Migrations is IEnumerable migrations) + foreach (var migration in migrations) + Convert(migration.Operations); + } else throw new NotImplementedException("Unhandled MigrationOperation " + migrationOperation.GetType().Name + " in " + GetType().Name); }