Tibo
Explore posts from serversDTDrizzle Team
•Created by Tibo on 4/18/2024 in #help
Cascade delete not working
I have this schema:
When I try to delete all the musics from an album I get this error:
update or delete on table "musics" violates foreign key constraint "musics_to_authors_music_id_musics_id_fk" on table "musics_to_authors"
Here's my delete: await db.delete(musics).where(eq(musics.albumId, albumId))
I don't understand what I'm doing wrong6 replies
DTDrizzle Team
•Created by Tibo on 3/29/2024 in #help
TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')
I'm getting this error when I want to rename a table (there are no other changes).
Old table:
New table:
Only the name changed so I don't understand why I'm getting this error.
What should I do ?
3 replies
DTDrizzle Team
•Created by Tibo on 3/17/2024 in #help
How to do inserts in many-to-many relations ?
I'm new to Drizzle and I don't really know if my tables relation is correct or not.
Here's the schema:
I chose to use a many-to-many relation because a music can have multiple authors and an author can have multiple music. Is my schema correct ?
Insert in comment
2 replies