Let's say I have two tables:
Code:
CREATE TABLE A (
id varchar(255) NOT NULL default '',
bone bigint(20),
btwo bigint(20),
PRIMARY KEY (id),
UNIQUE bone_unique (bone),
UNIQUE btwo_unique (btwo),
KEY bone_index (bone),
KEY btwo_index (btwo),
FOREIGN KEY (`bone`) REFERENCES `B` (`id`),
FOREIGN KEY (`btwo`) REFERENCES `B` (`id`)
) TYPE=InnoDB;
CREATE TABLE B (
id bigint(20) NOT NULL auto_increment',
PRIMARY KEY (id),
) TYPE=InnoDB;
I'd like to have the value "bone" resp. "btwo" set to "NULL" when deleting the corresponding entity of B.
How is this possible?
I'll appreciate any help.
Thanks a lot!
Sven