adding default to array of text creates invalid migrations
values: text('values').array().notNull().default(['a', 'b'])
generates:
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT a,b;
Should be:
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT ARRAY['a', 'b'];
5 Replies
Try like this:
I'm not very familiar with pg but that should work.
Thanks, I did not get a chance to try this method as I already edited the SQL manually and migrated.
Just reporting so this can be improved.
Can you create an issue in the repo?
Sure
GitHub
adding default to array of text creates invalid migrations · Issue ...
values: text('values').array().notNull().default(['a', 'b']) generates: ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT a,b; Should be: ALTER TABLE ...