[BUG]: Wrong column name when using PgEnum.array()
What version of drizzle-orm are you using?
0.30.6
What version of drizzle-kit are you using?
0.20.14
Describe the Bug
Given the following enum definition:
export const playerPosition = pgEnum("player_position", ['defender', 'midfield', 'attacker'])
I'm defininying this table, notice the column name being position:
export const players = pgTable("players", {
id: serial("id").primaryKey().notNull(),
position: playerPosition("position").array(),
});
Running drizzle-kit push:pg results in a correctly created table with id and position columns.
If I am to run drizzle-kit introspect:pg the position column gets renamed into playerPosition as if matching the enum name:
export const players = pgTable("players", {
id: serial("id").primaryKey().notNull(),
playerPosition: playerPosition("position").array(),
});
This only happens if I'm using a PgEnum.array() as a value, without using .array() it works as expected.
Expected behavior
Running drizzle-kit introspect:pg should keep the correct column name:
export const players = pgTable("players", {
id: serial("id").primaryKey().notNull(),
position: playerPosition("position").array(),
});
Environment & setup
No response
@realmikesolo any updates on this? I'm willing to look into it but I only found a mirror repository for drizzle-kit. Where should I be looking for the source code?
@dancamdev hey, I'll fix that in the next release. This one is fast fix, so shouldn't be a problem. Thanks a lot for your ticket!
@AndriiSherman thank you for the effort! I'll be waiting on the fix - do you have an ETA?
Any update on this guys?
This should be fixed in [email protected]
If you still encounter this issue, please reopen the ticket