Home >Database >Mysql Tutorial >mysql的外键多字段关联添加,也叫多外键?这名称怎么说~呵呵_MySQL

mysql的外键多字段关联添加,也叫多外键?这名称怎么说~呵呵_MySQL

WBOY
WBOYOriginal
2016-06-01 13:10:241380browse

Mysql外键


ALTER TABLE `table1` ADD CONSTRAINT `fk1` FOREIGN KEY (`t1`, `t2`) REFERENCES `table2` (`c1`, `c2`) ON DELETE CASCADE ON UPDATE CASCADE;

处理一个连锁项目的权限导致酱紫的情况真心不应该,删除了权限表的某一个权限,结果导致所有的其它连锁店权限组别的关联权限都没有了,原来在做组别和权限表关联的时候,其中一个外键忘了关联多字段;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn