From 24f592f9549a445145def160d918802ff757fd0f Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Mon, 17 Jan 2022 14:17:29 +0100 Subject: [PATCH] Add foreign key to products --- includes/pages/install.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/pages/install.php b/includes/pages/install.php index 8d645a4b..7bda3fdb 100644 --- a/includes/pages/install.php +++ b/includes/pages/install.php @@ -119,7 +119,10 @@ switch ($step) { $database->query('CREATE TABLE `products` ( `id` int NOT NULL PRIMARY KEY AUTO_INCREMENT, `wishlist` int NOT NULL, - `url` VARCHAR(255) NOT NULL, + `url` VARCHAR(255) NOT NULL + FOREIGN KEY (`wishlist`) + REFERENCES `wishlists` (id) + ON DELETE CASCADE );'); /**