20160925185400_add_foreign_keys_on_loans.sql 356 Bytes
Newer Older
thejoelinux's avatar
thejoelinux committed
1 2 3 4 5 6 7 8 9
ALTER TABLE `lud_loans` ADD INDEX(`game_id`);

ALTER TABLE `lud_loans` ADD INDEX(`member_id`);

ALTER TABLE `lud_loans` ADD FOREIGN KEY (`game_id`) 
    REFERENCES `lud_games`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
    
ALTER TABLE `lud_loans` ADD FOREIGN KEY (`member_id`) 
    REFERENCES `lud_members`(`id`)  ON DELETE RESTRICT ON UPDATE RESTRICT;