Mysql: Create Foreign Key
October 12th, 2008 by jeremychoneAssuming 1 to M from Person to Address:
ALTER TABLE address ADD
CONSTRAINT FK_address_person_id
FOREIGN KEY (person_id)
REFERENCES person(id) ON DELETE CASCADE
CONSTRAINT FK_address_person_id
FOREIGN KEY (person_id)
REFERENCES person(id) ON DELETE CASCADE