© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
stumpykilo

New enum values must be committed before they can be used

I have some INSERT statements in a couple of my migrations that use an enum that I have created in preceding migrations. When I go to run all of my migrations when creating a new instance of my db I receive the following message:
error: unsafe use of new value "MY_ENUM" of enum type
error: unsafe use of new value "MY_ENUM" of enum type
followed by the hint of
New enum values must be committed before they can be used
New enum values must be committed before they can be used
.

What I did to resolve is add
COMMIT;
COMMIT;
immediately after I add the enum in my preceding migrations.

Is that a good practice? Should this be something
drizzle-kit
drizzle-kit
adds when adding or altering enums?
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

can RLS be used without supabase/neon?
Drizzle TeamDTDrizzle Team / help
3mo ago
Why must batches be readonly?
Drizzle TeamDTDrizzle Team / help
2y ago
Can Drizzle be used for a multi-tenant app?
Drizzle TeamDTDrizzle Team / help
2mo ago
drizzle-kit overriding `process.env` before `@next/env` can load values
Drizzle TeamDTDrizzle Team / help
2y ago