Problem with ENUMs PostgreSQL

Hey all! I've been having issues with Drizzle migrate and would like some support in regards of how to fix the issue, regardless of what I do I keep getting the following: [⣻] applying migrations...error: type "activity_log_activity_enum" already exists
2 Replies
Anthony M.
Anthony M.OP3mo ago
drizzle kit generated SQL: https://pastes.dev/HurdWu84Lc my schema: https://pastes.dev/uUE0RRPnV3
pastes | HurdWu84Lc
A paste containing 484 lines of plaintext.
pastes | uUE0RRPnV3
A paste containing 541 lines of typescript.
Anthony M.
Anthony M.OP3mo ago
full error:
Using 'pg' driver for database querying
[⣻] applying migrations...error: type "activity_log_activity_enum" already exists
at C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\pg@8.13.1\node_modules\pg\lib\client.js:535:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at <anonymous> (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\pg-core\dialect.ts:102:7)
at NodePgSession.transaction (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\node-postgres\session.ts:193:19)
at PgDialect.migrate (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\pg-core\dialect.ts:95:3)
at migrate (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\node-postgres\migrator.ts:10:2) {
length: 106,
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: 'typecmds.c',
line: '1167',
routine: 'DefineEnum'
}
 ELIFECYCLE  Command failed with exit code 1.
Using 'pg' driver for database querying
[⣻] applying migrations...error: type "activity_log_activity_enum" already exists
at C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\pg@8.13.1\node_modules\pg\lib\client.js:535:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at <anonymous> (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\pg-core\dialect.ts:102:7)
at NodePgSession.transaction (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\node-postgres\session.ts:193:19)
at PgDialect.migrate (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\pg-core\dialect.ts:95:3)
at migrate (C:\Users\Anthony\VSCodeProjects\BerryBot\node_modules\.pnpm\drizzle-orm@0.38.1_@types+pg@8.11.10_mysql2@3.11.4_pg@8.13.1\node_modules\src\node-postgres\migrator.ts:10:2) {
length: 106,
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: 'typecmds.c',
line: '1167',
routine: 'DefineEnum'
}
 ELIFECYCLE  Command failed with exit code 1.
also just so if you're going to say I should do something like suggestionStatusEnum('status') instead of suggestionStatusEnum() I did that before what I sent, same result.

Did you find this page helpful?