stumpykilo
DTDrizzle Team
•Created by stumpykilo on 5/3/2024 in #help
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?3 replies
DTDrizzle Team
•Created by stumpykilo on 3/19/2024 in #help
How do I create a postgres enum for a different schema?
if i create a postgres schema like this
export const audit = pgSchema("audit");
i am unable to create an enum like this export const myEnum = audit.enum("my_enum", ["A", "B", "C"]);
. the only options i have are .schemaName
, .table
, .view
. what should i do instead?2 replies