drizzle can't migrate, SQL input error: table `tasks` already exists (at offset 13)'

hello! i'm using drizzle-ormversion ^0.30.7, next v.14.0.4. i want to push the my changes to the turso db. firstly i run db:generate then db:migrate i got this error. wonder what's causing this to happen?
bun db:migrate
$ dotenv -c -- tsx ./migrate.ts
(node:6681) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
error inside the migration
LibsqlError: SQL_INPUT_ERROR: SQL input error: table `tasks` already exists (at offset 13)
at mapHranaError (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/@libsql/client/lib-cjs/hrana.js:287:16)
at HttpClient.batch (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/@libsql/client/lib-cjs/http.js:113:48)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at LibSQLSession.batch (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/src/libsql/session.ts:75:24)
at migrate (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/src/libsql/migrator.ts:50:2)
at main (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/migrate.ts:8:5) {
code: 'SQL_INPUT_ERROR',
rawCode: undefined,
[cause]: [ResponseError: SQL input error: table `tasks` already exists (at offset 13)] {
code: 'SQL_INPUT_ERROR',
proto: {
message: 'SQL input error: table `tasks` already exists (at offset 13)',
code: 'SQL_INPUT_ERROR'
}
}
}
bun db:migrate
$ dotenv -c -- tsx ./migrate.ts
(node:6681) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
error inside the migration
LibsqlError: SQL_INPUT_ERROR: SQL input error: table `tasks` already exists (at offset 13)
at mapHranaError (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/@libsql/client/lib-cjs/hrana.js:287:16)
at HttpClient.batch (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/@libsql/client/lib-cjs/http.js:113:48)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at LibSQLSession.batch (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/src/libsql/session.ts:75:24)
at migrate (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/node_modules/src/libsql/migrator.ts:50:2)
at main (/Users/rezaarya4/Documents/code-adventure/projects/approvement-app/migrate.ts:8:5) {
code: 'SQL_INPUT_ERROR',
rawCode: undefined,
[cause]: [ResponseError: SQL input error: table `tasks` already exists (at offset 13)] {
code: 'SQL_INPUT_ERROR',
proto: {
message: 'SQL input error: table `tasks` already exists (at offset 13)',
code: 'SQL_INPUT_ERROR'
}
}
}
1 Reply
Zeitgeist
Zeitgeist7mo ago
Hmm, i'm getting the equivalent of this after i upgraded to 0.30.8 on Postgres. I wonder if something is not detecting the migrations have already been run.
Want results from more Discord servers?
Add your server