ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข3y agoโ€ข
5 replies
ak4zh

adding default to array of text creates invalid migrations

values: text('values').array().notNull().default(['a', 'b'])
values: text('values').array().notNull().default(['a', 'b'])


generates:
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT a,b;
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT a,b;


Should be:
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT ARRAY['a', 'b'];
ALTER TABLE "test" ALTER COLUMN "values" SET DEFAULT ARRAY['a', 'b'];



"drizzle-orm": "^0.28.3",
"drizzle-kit": "^0.19.13",
"pg": "^8.11.3"
"drizzle-orm": "^0.28.3",
"drizzle-kit": "^0.19.13",
"pg": "^8.11.3"
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using default with `text` json mode creates empty `DEFAULT`
Drizzle TeamDTDrizzle Team / help
2y ago
Default value for Array creates an incorrect SQL migration
Drizzle TeamDTDrizzle Team / help
3y ago
Empty default array
Drizzle TeamDTDrizzle Team / help
2y ago
Psql Array of text and `createSelectSchema`, `createInsertSchema`
Drizzle TeamDTDrizzle Team / help
3y ago