enum label already exists

Running drizzle-kit push in the latest version gives me this strange error:
error: enum label "CLOSED" already exists
at C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:62378:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:104414:26)
at async pgPush (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:107483:13)
at async Command.<anonymous> (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:114367:7) {
length: 92,
severity: 'ERROR',
code: '42710',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'pg_enum.c',
line: '267',
routine: 'AddEnumLabel'
}
error: enum label "CLOSED" already exists
at C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:62378:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:104414:26)
at async pgPush (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:107483:13)
at async Command.<anonymous> (C:\Boxem\packages\core-db\node_modules\drizzle-kit\bin.cjs:114367:7) {
length: 92,
severity: 'ERROR',
code: '42710',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'pg_enum.c',
line: '267',
routine: 'AddEnumLabel'
}
I didnt change any enum with that label. Why the hell is drizzle-kit trying to add an enum label that already exists?
1 Reply
faslin_kosta
faslin_kosta4mo ago
Hi, I got this error as well. I managed to get past it by changing my column to text (values did not change and table did not get truncated). Then I deleted the enum an created it again with the same values in the same order, after which I went in and changed the type of my column to the enum again (values did not change again, table stayed in tact) And it worked! I was using the supabase UI to do these operations, but I guess normal SQL query would do the same. Don't know what miracle causes this but here you go.
Want results from more Discord servers?
Add your server