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
followed by the hint of New enum values must be committed before they can be used
.
What I did to resolve is add COMMIT;
immediately after I add the enum in my preceding migrations.
Is that a good practice? Should this be something drizzle-kit
adds when adding or altering enums?2 Replies
I just ran into the same issue! very odd, but used the same fix to get through it. feels a bit flaky though
Had to the same just now.
is this something that's on the radar? 👀 @Andrew Sherman