Default value for {:array, :atom} attribute
Hello,
I'm trying to have a default value when using an {:array, :atom} attribute like this:
But when I try to persist a new instance of this resource it fails because :roles is empty.
Also, when generating a migration I get this error:
5 Replies
Ah... ops, the first part of my question is not true, I forgot to run the migration so it was failing because of that and not because the roles field was empty...
But that warning is still there when generating the migration, is it safe to just ignore it?
That warning is just letting you know that you have to manually edit the migration to set that default for Postgres. You specified it correctly, it's just a case that the migration generator doesn't know how to automatically handle.
So, I edited the migration file and added the default value, but the warning still shows up, can I stop it from showing after the default value is added to the migration file somehow?
You don’t do it by editing the migration, you specify in the resource
Thank you, that fixed it!