You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been having some issues when instrospecting a postgres schema with enum types. The PgEnums are generated in the Drizzle schema, but the columns that use them get an unknown() type. It looks like this
exportconstcolorEnum=pgEnum('color_enum',['red','green','blue'])exportconstmyDbSchema=pgSchema('my_db_schema')exportconstsillyHat=myDbSchema.pgTable('silly hat',{id: serial('id').primaryKey(),// TODO: failed to parse database type 'fraud_dev.variable_type'color: unknown('hat')})
Based on the inserted comment I believe the issue is that drizzle-kit is trying to access the enum on myDbSchema, but the actual enum is defined outside it, on the database itself.
The text was updated successfully, but these errors were encountered:
Similar if not the same issue I'm running into, is that colorEnum in my case is part of myDbSchema but introspected as if part of the default (public) schema.
This means that the migration file will create a duplicate of myDbSchema.colorEnum aspublic.colorEnum, which will fail postgres operations due to the schema mismatch on the enum, since they're technically different objects
I have been having some issues when instrospecting a postgres schema with enum types. The
PgEnums
are generated in the Drizzle schema, but the columns that use them get anunknown()
type. It looks like thisBased on the inserted comment I believe the issue is that drizzle-kit is trying to access the enum on myDbSchema, but the actual enum is defined outside it, on the database itself.
The text was updated successfully, but these errors were encountered: