[BUG?] Handling Postgresql schemas when using enums

"drizzle-orm": "^0.30.10" Hello. I have a simple table with a status column
export const BaseSchema = pgSchema(settings.DB_SCHEMA_NAME); // DB_SCHEMA_NAME=my_schema
export const statusEnum = BaseSchema.enum("version_status", values);

export const versions = BaseSchema.table("versions", {
status: statusEnum("status").default(VersionStatus.draft),
// ...rest columns
});
export const BaseSchema = pgSchema(settings.DB_SCHEMA_NAME); // DB_SCHEMA_NAME=my_schema
export const statusEnum = BaseSchema.enum("version_status", values);

export const versions = BaseSchema.table("versions", {
status: statusEnum("status").default(VersionStatus.draft),
// ...rest columns
});
When I generate new migration I get this
CREATE TYPE "version_status" AS ENUM('draft', 'published', 'inactive');
CREATE TYPE "version_status" AS ENUM('draft', 'published', 'inactive');
But it does not consider DB_SCHEMA_NAME, and this type will be stored in public.object types instead of my_schema.object types I expect something like this:
CREATE TYPE "my_schema"."version_status" AS ENUM('draft', 'published', 'inactive');
CREATE TYPE "my_schema"."version_status" AS ENUM('draft', 'published', 'inactive');
1 Reply
eXecuteye
eXecuteye8mo ago
Ran into the same issue today
Want results from more Discord servers?
Add your server