Skip to content

Commit f9d1329

Browse files
committed
fix: ensure prefix is set even with create_schemas_in_migrations? false
1 parent cb93a8f commit f9d1329

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/migration_generator/phase.ex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ defmodule AshPostgres.MigrationGenerator.Phase do
1919
Enum.map_join(operations, "\n", fn operation -> operation.__struct__.up(operation) end) <>
2020
"\nend"
2121
else
22-
{pre_create, opts} =
22+
pre_create =
2323
if schema && repo.create_schemas_in_migrations?() do
24-
{"execute(\"CREATE SCHEMA IF NOT EXISTS #{schema}\")" <> "\n\n",
25-
", prefix: \"#{schema}\""}
24+
"execute(\"CREATE SCHEMA IF NOT EXISTS #{schema}\")" <> "\n\n"
2625
else
27-
{"", ""}
26+
""
27+
end
28+
29+
opts =
30+
if schema do
31+
", prefix: \"#{schema}\""
32+
else
33+
""
2834
end
2935

3036
pre_create <>

0 commit comments

Comments
 (0)