我已经在MySql数据库中创建了两个表:
create table scope (
name_scope varchar(50) not null primary key,
description varchar(100)
);
create table value_scope (
id_value int not null primary key AUTO_INCREMENT,
name_scope varchar(50) not null,
value varchar(100) not null,
foreign key (name_scope) references scope(name_scope) ON DELETE CASCADE
);一个作用域可以有多个值。当我删除一个作用域时,我希望它各自的值也被删除,但是什么也没有发生。我试着用相反的方式去做,但是范围仍然存在。
我做错了什么?
发布于 2014-01-02 18:12:09
相反,MyISAM不支持referential integrity.Use InnoDB。
https://stackoverflow.com/questions/15768262
复制相似问题