Skip to content

Commit 2c4a7ae

Browse files
committed
Make reference expression generator correct
1 parent 91483d5 commit 2c4a7ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ecto/adapters/exqlite/connection.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,13 +1522,15 @@ defmodule Ecto.Adapters.Exqlite.Connection do
15221522
defp options_expr(options), do: [?\s, to_string(options)]
15231523

15241524
defp reference_expr(%Reference{} = ref, table, name) do
1525+
{_, reference_columns} = Enum.unzip([{name, ref.column} | ref.with])
1526+
15251527
[
15261528
" CONSTRAINT ",
15271529
reference_name(ref, table, name),
15281530
" REFERENCES ",
1529-
quote_table(table.prefix, ref.table),
1531+
quote_table(ref.prefix || table.prefix, ref.table),
15301532
?(,
1531-
quote_name(ref.column),
1533+
quote_names(reference_columns),
15321534
?),
15331535
reference_on_delete(ref.on_delete),
15341536
reference_on_update(ref.on_update)

0 commit comments

Comments
 (0)