RsD0p9BK
7/19/2017 - 5:00 AM

sql__foreign_key.sql

SET FOREIGN_KEY_CHECKS = 0;

ALTER TABLE Orders
ADD CONSTRAINT FK_PersonOrder
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);

SET FOREIGN_KEY_CHECKS = 1;

-- https://www.w3schools.com/sql/sql_foreignkey.asp
-- https://stackoverflow.com/questions/5005388/cannot-add-or-update-a-child-row-a-foreign-key-constraint-fails