Add wishlists_saved table
This commit is contained in:
parent
ee756802b0
commit
4d004d55b5
2 changed files with 24 additions and 0 deletions
|
@ -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
10
src/update/0-6-0.sql
Normal 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`);
|
Loading…
Reference in a new issue