sql 添加级联删除和级联更新

添加级联删除 :

mysql> alter table t_orderitem add constraint `FK...` foreign key (oid) references t_orders (oid) on delete cascade;

添加级联更新 :

mysql> alter table t_orderitem add constraint `FK...` foreign key (oid) references t_orders (oid) on update cascade;


删除约束:

mysql>alter table t_orderitem drop foreign key `FK...`;

你可能感兴趣的:(mysql)