Skip to content

Commit 6fd74b9

Browse files
committed
Use platform newline in schema ensure migrations SQL
Fixes #2512
1 parent 78085e9 commit 6fd74b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,11 @@ protected override void Generate(EnsureSchemaOperation operation, IModel? model,
955955
}
956956

957957
builder.AppendLine(
958-
$@" IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = '{schemaName}') THEN
959-
CREATE SCHEMA {DelimitIdentifier(operation.Name)};
960-
END IF;");
958+
$@" IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = '{schemaName}') THEN"
959+
+ Environment.NewLine
960+
+ $" CREATE SCHEMA {DelimitIdentifier(operation.Name)};"
961+
+ Environment.NewLine
962+
+ " END IF;");
961963

962964
if (!Options.HasFlag(MigrationsSqlGenerationOptions.Idempotent))
963965
{

0 commit comments

Comments
 (0)