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.
Comments on Create self-referencing many-to-many relation
Post
Create self-referencing many-to-many relation [closed]
Closed as unclear by Karl Knechtel on Aug 15, 2026 at 04:02
This question cannot be answered in its current form, because critical information is missing.
This question was closed; new answers can no longer be added. Users with the Vote on Holds ability may vote to reopen this question if it has been improved or closed incorrectly.
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`)
);

1 comment thread