【数据库】联合主键 删除

关于数据库联合主键或者级联的删除作个笔记....code from 超哥。

 

alter table jounalmessage drop Foreign_Key_Name;

alter table journalmessage add constraint kaho foreign key(user_id,journal_id) references journal

(user_id,journal_id) on delete set null on update cascade;

on delete set null on update cascade;

on delete cascade on update cascade;

你可能感兴趣的:(【数据库】)