DT
Drizzle Team•14mo ago
zeekrey

Is there a --force flag for drizzle-kit push?

Hey there! 👋 I'm having all sorts of problems when pushing changes to my database during prototyping. I end up deleting the SQLite DB and creating a new one. Is there a way to somehow force push the changes?
1 Reply
Zephury
Zephury•14mo ago
yeah... getting really sick of having to wipe my entire database every time I want a new migration during development. Makes me very apprehensive to use in prod. In my case, I had an id field that was a bigint, which used to be a generated id; it's for languages, so I decided to switch the id field to varchar and use iso language abbreviations instead, but I can't push, nor complete a migration with it:
error: foreign key constraint "profile_language_language_id_language_id_fk" cannot be implemented
at D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:24378:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:25339:21)
at async Command.<anonymous> (D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:61152:9) {
length: 257,
severity: 'ERROR',
code: '42804',
detail: 'Key columns "language_id" and "id" are of incompatible types: character varying and bigint.',
error: foreign key constraint "profile_language_language_id_language_id_fk" cannot be implemented
at D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:24378:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:25339:21)
at async Command.<anonymous> (D:\dev\{{project_name}}\api\node_modules\drizzle-kit\bin.cjs:61152:9) {
length: 257,
severity: 'ERROR',
code: '42804',
detail: 'Key columns "language_id" and "id" are of incompatible types: character varying and bigint.',
checked every file and did a file search to see if anything still tried implementing it as a foreign key, but no, all foreign key references are switched to varchar as well. There is no more bigint related to language in my application.
Want results from more Discord servers?
Add your server