MySQL 设置cascade on delete on update
2012-03-08 14:18
531 查看
Here's what you'd include in your components table. CREATE TABLE `components` ( `id` int(10) unsigned NOT NULL auto_increment, `typeId` int(10) unsigned NOT NULL, `moreInfo` VARCHAR(32), -- etc PRIMARY KEY (`id`), KEY `type` (`typeId`) CONSTRAINT `myForeignKey` FOREIGN KEY (`typeId`) REFERENCES `types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) Just remember that you need to use the InnoDB storage engine: the default MyISAM storage engine doesn't support foreign keys.
相关文章推荐
- 如果mysql里的cascade 设置为ON DELETE CASCADE注意的小问题
- mysql SQL设置外键约束ON DELETE CASCADE
- mysql SQL设置外键约束ON DELETE CASCADE
- ON UPDATE CASCADE ON DELETE CASCADE
- ON DELETE CASCADE ON UPDATE CASCADE
- on update cascade 和on delete cascade 的作用
- ON UPDATE CASCADE ON DELETE CASCADE
- 【转】MySQL外键约束On Delete、On Update各取值的含义
- 数据库级联更新 on update cascade和级联删除 on delete cascade
- MySQL外键约束On Delete和On Update的详解
- phpmyadmin中MySQL外键约束On Delete、On Update各选项解释
- 级联操作--on delete/update cascade
- sql 外键 on update cascade 和 on delete cascade 作用区别?
- ON DELETE CASCADE和ON UPDATE CASCADE
- 数据库_级联更新/级联删除_ON UPDATE CASCADE/ON DELETE CASCADE
- SQL SERVER 主键和外键中的 级联删除(ON DELETE CASCADE)和级联更新(ON UPDATE CASCADE)
- Mysql 的on update/on delete定义父表上进行update/delete是更新或删除在子表的情况
- MySQL外键约束On Delete、On Update各取值的含义
- on update cascade 和on delete cascade 的区别
- MySQL外键约束On Delete、On Update各取值的含义