diff --git a/src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs b/src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs index eea5633c5..6c74ef60a 100644 --- a/src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs +++ b/src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs @@ -1132,7 +1132,7 @@ protected virtual void GenerateCreateExtension( .Append(DelimitIdentifier(extension.Version)); } - builder.AppendLine(";"); + builder.AppendLine(" CASCADE;"); } #region Collation management diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs index 137d43ab8..46a2d6122 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs @@ -2688,7 +2688,7 @@ await Test( Assert.Equal("public", citext.Schema); }); - AssertSql("CREATE EXTENSION IF NOT EXISTS citext;"); + AssertSql("CREATE EXTENSION IF NOT EXISTS citext CASCADE;"); } [Fact] @@ -2714,7 +2714,7 @@ IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'some_schema') THEN END $EF$; """, // - @"CREATE EXTENSION IF NOT EXISTS citext SCHEMA some_schema;"); + @"CREATE EXTENSION IF NOT EXISTS citext SCHEMA some_schema CASCADE;"); } #endregion