Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I've turned the tables movies and scenes into media and now I don't know what to do with the movies_scenes relation. CREATE TABLE IF NOT EXISTS "movies_scenes" ( `movie_id` integer, `sce...
Question
database-schema
#1: Initial revision
Create self-referencing many-to-many relation
I've turned the tables `movies` and `scenes` into `media` and now I don't know what to do with the `movies_scenes` relation. ``` CREATE TABLE IF NOT EXISTS "movies_scenes" ( `movie_id` integer, `scene_id` integer, `scene_index` tinyint, foreign key(`movie_id`) references `movies`(`id`) on delete cascade, foreign key(`scene_id`) references `scenes`(`id`) on delete cascade, PRIMARY KEY(`movie_id`, `scene_id`) ); ```