Hey I have a column defined as such:
add(:variations, {:array, :string})
I want to run a migration to set every null to an empty list, but it seems troublesome.
I got it finally by doing this:
from(
from(bai in "business_accounts_items",
where: is_nil(bai.variations),
update: [set: [variations: fragment("ARRAY[]::text[]")]]
)
)
|> Repo.update_all([])
Is this the way to do it properly? specifically the
update: [set: [variations: fragment(“ARRAY::text”)]]
part
Thanks!