Refactor
This commit is contained in:
parent
14ee9d09fd
commit
7292caecf4
1 changed files with 13 additions and 13 deletions
|
@ -112,11 +112,11 @@ switch ($step) {
|
||||||
* Users
|
* Users
|
||||||
*/
|
*/
|
||||||
$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,
|
`password` VARCHAR(128) NOT NULL,
|
||||||
`last_login` datetime NOT NULL DEFAULT NOW(),
|
`last_login` datetime NOT NULL DEFAULT NOW(),
|
||||||
`power` int NOT NULL DEFAULT 0
|
`power` INT NOT NULL DEFAULT 0
|
||||||
);');
|
);');
|
||||||
$database->query('CREATE INDEX `idx_password` ON `users` (`password`);');
|
$database->query('CREATE INDEX `idx_password` ON `users` (`password`);');
|
||||||
|
|
||||||
|
@ -124,10 +124,10 @@ switch ($step) {
|
||||||
* Wishlists
|
* Wishlists
|
||||||
*/
|
*/
|
||||||
$database->query('CREATE TABLE `wishlists` (
|
$database->query('CREATE TABLE `wishlists` (
|
||||||
`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,
|
`hash` VARCHAR(128) NOT NULL,
|
||||||
FOREIGN KEY (`user`)
|
FOREIGN KEY (`user`)
|
||||||
REFERENCES `users` (`id`)
|
REFERENCES `users` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
|
@ -138,8 +138,8 @@ switch ($step) {
|
||||||
* Wishes
|
* Wishes
|
||||||
*/
|
*/
|
||||||
$database->query('CREATE TABLE `wishes` (
|
$database->query('CREATE TABLE `wishes` (
|
||||||
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
`id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
`wishlist` int NOT NULL,
|
`wishlist` INT NOT NULL,
|
||||||
`type` VARCHAR(32) NULL DEFAULT NULL,
|
`type` VARCHAR(32) NULL DEFAULT NULL,
|
||||||
`url` VARCHAR(255) NULL DEFAULT NULL,
|
`url` VARCHAR(255) NULL DEFAULT NULL,
|
||||||
`status` VARCHAR(32) NULL DEFAULT NULL,
|
`status` VARCHAR(32) NULL DEFAULT NULL,
|
||||||
|
@ -152,9 +152,9 @@ switch ($step) {
|
||||||
* Options
|
* Options
|
||||||
*/
|
*/
|
||||||
$database->query('CREATE TABLE `options` (
|
$database->query('CREATE TABLE `options` (
|
||||||
`id` int PRIMARY KEY AUTO_INCREMENT,
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
`key` varchar(64) NOT NULL UNIQUE,
|
`key` VARCHAR(64) NOT NULL UNIQUE,
|
||||||
`value` varchar(128) NOT NULL
|
`value` VARCHAR(128) NOT NULL
|
||||||
);');
|
);');
|
||||||
|
|
||||||
$database->query('INSERT INTO `options`
|
$database->query('INSERT INTO `options`
|
||||||
|
|
Loading…
Reference in a new issue