Add wishlists_saved table

This commit is contained in:
Jay Trees 2022-04-11 13:34:30 +02:00
parent ee756802b0
commit 4d004d55b5
2 changed files with 24 additions and 0 deletions

View file

@ -156,6 +156,20 @@ switch ($step) {
);'); );');
$database->query('CREATE INDEX `idx_hash` ON `wishlists` (`hash`);'); $database->query('CREATE INDEX `idx_hash` ON `wishlists` (`hash`);');
/**
* Wishlists Saved
*/
$database->query('DROP TABLE IF EXISTS `wishlists_saved`;');
$database->query('CREATE TABLE `wishlists_saved` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`user` INT NOT NULL,
`wishlist` INT NOT NULL,
FOREIGN KEY (`user`)
REFERENCES `users` (`id`)
ON DELETE CASCADE
);');
$database->query('CREATE INDEX `idx_wishlist` ON `wishlists_saved` (`wishlist`);');
/** /**
* Wishes * Wishes
*/ */

10
src/update/0-6-0.sql Normal file
View file

@ -0,0 +1,10 @@
CREATE TABLE `wishlists_saved` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`user` INT NOT NULL,
`wishlist` INT NOT NULL,
FOREIGN KEY (`user`)
REFERENCES `users` (`id`)
ON DELETE CASCADE
);
CREATE INDEX `idx_wishlist` ON `wishlists_saved` (`wishlist`);