I want to copy value from existing field to new field in migration file but field type is different.
names type is{:array, :string}
name type is string
query = from t in "tags", update: [set: [name: ^get_name(t.names)]]
Repo.update_all(query)
def get_name(names), do: Enum.at(names, 0)
As I expected, it won’t work
variable "t" does not exist and is being expanded to "t()"
How can I do this correctly?