Fork me on GitHub
#sql
<
2020-09-30
>
dharrigan06:09:28

when you say delete everything do you also mean tags too?

dharrigan06:09:43

btw your table for the join could be rewritten as this:

dharrigan06:09:41

create table post_tag (post_id int references post on delete cascade, tag_id int references tag on delete cascade, primary key (post_id, tag_id));

emccue21:09:18

@dharrigan yes, but its just curiousity - I think the real answer is the trigger