Fix indexes
This commit is contained in:
parent
dbec05da6a
commit
ec4fafd5c0
1 changed files with 5 additions and 2 deletions
|
@ -101,8 +101,9 @@ switch ($step) {
|
||||||
$database->query('CREATE TABLE `users` (
|
$database->query('CREATE TABLE `users` (
|
||||||
`id` int PRIMARY KEY AUTO_INCREMENT,
|
`id` int PRIMARY KEY AUTO_INCREMENT,
|
||||||
`email` varchar(64) NOT NULL UNIQUE,
|
`email` varchar(64) NOT NULL UNIQUE,
|
||||||
`password` varchar(128) NOT NULL INDEX
|
`password` varchar(128) NOT NULL
|
||||||
);');
|
);');
|
||||||
|
$database->query('CREATE INDEX `idx_password` ON `users` (`password`);');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wishlists
|
* Wishlists
|
||||||
|
@ -111,10 +112,12 @@ switch ($step) {
|
||||||
`id` int PRIMARY KEY AUTO_INCREMENT,
|
`id` int PRIMARY KEY AUTO_INCREMENT,
|
||||||
`user` int NOT NULL,
|
`user` int NOT NULL,
|
||||||
`name` varchar(128) NOT NULL,
|
`name` varchar(128) NOT NULL,
|
||||||
|
`hash` varchar(128) NOT NULL,
|
||||||
FOREIGN KEY (`user`)
|
FOREIGN KEY (`user`)
|
||||||
REFERENCES `users` (`id`)
|
REFERENCES `users` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
);');
|
);');
|
||||||
|
$database->query('CREATE INDEX `idx_hash` ON `wishlists` (`hash`);');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Products
|
* Products
|
||||||
|
@ -122,7 +125,7 @@ switch ($step) {
|
||||||
$database->query('CREATE TABLE `products` (
|
$database->query('CREATE TABLE `products` (
|
||||||
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
`wishlist` int NOT NULL,
|
`wishlist` int NOT NULL,
|
||||||
`hash` VARCHAR(255) NOT NULL INDEX,
|
`url` VARCHAR(255) NOT NULL,
|
||||||
FOREIGN KEY (`wishlist`)
|
FOREIGN KEY (`wishlist`)
|
||||||
REFERENCES `wishlists` (`id`)
|
REFERENCES `wishlists` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
|
|
Loading…
Reference in a new issue