DT
Drizzle Team•3mo ago
Nick

Sharing a database - Keeps trying to drop other tables when pushing tables with the different prefix

So I've got tables with the prefix chris-woodward-gallery and cars-under-20k. I was learning, and still am, so want to make the use of vercel's free db. Problem is I've set up my schema to prefix the tables, and removed any reference to the chris-woodward-gallery variant, but when I push it still say it's trying to drop those tables. As a big-old-noob I'm struggling to debug this tbh:
PostgresError: cannot drop sequence "chris-woodward-gallery_address_id_seq" because other objects depend on it
//snip
severity_local: 'ERROR',
severity: 'ERROR',
code: '2BP01',
detail: 'default value for column id of table "chris-woodward-gallery_address" depends on sequence "chris-woodward-gallery_address_id_seq"',
hint: 'Use DROP ... CASCADE to drop the dependent objects too.',
file: 'dependency.c',
line: '1204',
}
PostgresError: cannot drop sequence "chris-woodward-gallery_address_id_seq" because other objects depend on it
//snip
severity_local: 'ERROR',
severity: 'ERROR',
code: '2BP01',
detail: 'default value for column id of table "chris-woodward-gallery_address" depends on sequence "chris-woodward-gallery_address_id_seq"',
hint: 'Use DROP ... CASCADE to drop the dependent objects too.',
file: 'dependency.c',
line: '1204',
}
1 Reply
rphlmr âš¡
rphlmr ⚡•3mo ago
👋 since you remove these tables from your schema.ts, Drizzle try to drop them. But you have some references in some tables with no cascade condition (update, delete) and that’s why it fails. Drizzle doesn’t put drop commands in a particular order so maybe you have to do that step by step or fix cascading first
Want results from more Discord servers?
Add your server