Cascade doesn't work

Hello I use drizzle with bun:sqlite , I use onDelete cascade in reference but it doesn't work on app leve , it seem work on database level when deleting from dbviewer.
3 Replies
SandCat
SandCat5mo ago
Any Solution please am migrating my project from sequelize evrything work nice am just stuck with delete cascade doesn't work now
san4d
san4d5mo ago
Can you provide some code examples? I use this feature fine in Drizzle. Make sure you're specifying the attribute on the table definition:
parentId: uuid('parent_id')
.references(() => parent.id, { onDelete: 'cascade' })
.notNull(),
parentId: uuid('parent_id')
.references(() => parent.id, { onDelete: 'cascade' })
.notNull(),
SandCat
SandCat5mo ago
I use it like this too
achat_id: integer('achat_id').references(() => achats.id, { onDelete: 'cascade' }).notNull()
achat_id: integer('achat_id').references(() => achats.id, { onDelete: 'cascade' }).notNull()
But i use it with Bun:sqlite
Want results from more Discord servers?
Add your server