mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-19 13:03:14 +12:00
fix: ensure index keys are atoms in generated migrations
This commit is contained in:
parent
1af3f7d273
commit
aa40778cc4
2 changed files with 2 additions and 2 deletions
|
@ -3266,7 +3266,7 @@ defmodule AshPostgres.MigrationGenerator do
|
|||
:keys,
|
||||
&Enum.map(&1, fn
|
||||
["sql", value] when is_binary(value) -> {:sql, value}
|
||||
key -> maybe_to_atom(key)
|
||||
key -> key
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ defmodule AshPostgres.MigrationGenerator.Operation do
|
|||
def as_atom(value), do: Macro.inspect_atom(:remote_call, String.to_atom(value))
|
||||
|
||||
def index_key({:sql, value}) when is_binary(value), do: inspect(value)
|
||||
def index_key(value) when is_binary(value) or is_atom(value), do: inspect(value)
|
||||
def index_key(value) when is_binary(value) or is_atom(value), do: ":#{as_atom(value)}"
|
||||
|
||||
def option(key, value) when key in [:nulls_distinct, "nulls_distinct"] do
|
||||
if !value do
|
||||
|
|
Loading…
Reference in a new issue