级联删除设置外键方法

 alter table orders add constraint FK_CUSTOMER foreign key (customer_id) references customers(id);

 alter table orders add constraint FK_CUSTOMER foreign key (customer_id) references customers(id)  on delete cascade on update cascade;

你可能感兴趣的:(删除)