Issues on first migrate after pull

Hello! I am getting an error after trying to do a migrate on a database I just pulled using drizzle-kit, seems to be something related to the commenting syntax being used. I have seen some workarounds online but I was wondering if there is maybe a smarter way to go about this or if it's mapped as an issue to be fixed.
✗ npx drizzle-kit migrate --config=drizzle.config.ts
Reading config file '/Users/pc/Dev/service/drizzle.config.ts'
Using 'pg' driver for database querying
[⣷] applying migrations...DrizzleQueryError: Failed query: -- Current sql file was generated after introspecting the database
-- If you want to run this migration please uncomment this code before executing migrations
/*
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');
params:
at NodePgPreparedQuery.queryWithCache (/Users/pc/Dev/service/node_modules/src/pg-core/session.ts:74:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:109:7)
... 2 lines matching cause stack trace ...
at async migrate (/Users/pc/Dev/service/node_modules/src/node-postgres/migrator.ts:11:2) {
query: '-- Current sql file was generated after introspecting the database\n' +
'-- If you want to run this migration please uncomment this code before executing migrations\n' +
'/*\n' +
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');,
params: [],
cause: error: unterminated /* comment at or near "/*
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');"
at /Users/pc/Dev/service/node_modules/pg/lib/client.js:535:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/node-postgres/session.ts:157:14)
at async NodePgPreparedQuery.queryWithCache (/Users/pc/Dev/service/node_modules/src/pg-core/session.ts:72:12)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:109:7)
at async NodePgSession.transaction (/Users/pc/Dev/service/node_modules/src/node-postgres/session.ts:318:19)
at async PgDialect.migrate (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:102:3)
at async migrate (/Users/pc/Dev/service/node_modules/src/node-postgres/migrator.ts:11:2) {
length: 184,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '160',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1236',
routine: 'scanner_yyerror'
}
}
✗ npx drizzle-kit migrate --config=drizzle.config.ts
Reading config file '/Users/pc/Dev/service/drizzle.config.ts'
Using 'pg' driver for database querying
[⣷] applying migrations...DrizzleQueryError: Failed query: -- Current sql file was generated after introspecting the database
-- If you want to run this migration please uncomment this code before executing migrations
/*
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');
params:
at NodePgPreparedQuery.queryWithCache (/Users/pc/Dev/service/node_modules/src/pg-core/session.ts:74:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:109:7)
... 2 lines matching cause stack trace ...
at async migrate (/Users/pc/Dev/service/node_modules/src/node-postgres/migrator.ts:11:2) {
query: '-- Current sql file was generated after introspecting the database\n' +
'-- If you want to run this migration please uncomment this code before executing migrations\n' +
'/*\n' +
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');,
params: [],
cause: error: unterminated /* comment at or near "/*
CREATE TYPE "public"."enum_status" AS ENUM('pending', 'past_due');"
at /Users/pc/Dev/service/node_modules/pg/lib/client.js:535:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/node-postgres/session.ts:157:14)
at async NodePgPreparedQuery.queryWithCache (/Users/pc/Dev/service/node_modules/src/pg-core/session.ts:72:12)
at async <anonymous> (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:109:7)
at async NodePgSession.transaction (/Users/pc/Dev/service/node_modules/src/node-postgres/session.ts:318:19)
at async PgDialect.migrate (/Users/pc/Dev/service/node_modules/src/pg-core/dialect.ts:102:3)
at async migrate (/Users/pc/Dev/service/node_modules/src/node-postgres/migrator.ts:11:2) {
length: 184,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '160',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1236',
routine: 'scanner_yyerror'
}
}
Versions:
"drizzle-kit": "^1.0.0-beta.1-ac4ce44",
"drizzle-orm": "^1.0.0-beta.1-ac4ce44"
"drizzle-kit": "^1.0.0-beta.1-ac4ce44",
"drizzle-orm": "^1.0.0-beta.1-ac4ce44"
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?