mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
Add user table + funcs
This commit is contained in:
parent
c6ef84cd5a
commit
671254223a
12 changed files with 172 additions and 571 deletions
|
@ -1 +1 @@
|
|||
DROP TABLE IF EXISTS `goscrobble`;
|
||||
DROP TABLE IF EXISTS `config`;
|
|
@ -1,13 +1,5 @@
|
|||
START TRANSACTION;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `goscrobble` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`version` INT(11) NOT NULL DEFAULT 1
|
||||
`name` VARCHAR(255) NULL DEFAULT '',
|
||||
`url` VARCHAR(255) NULL DEFAULT '',
|
||||
PRIMARY KEY(`id`)
|
||||
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci;
|
||||
|
||||
INSERT INTO `goscrobble` (version) VALUES (1);
|
||||
|
||||
COMMIT;
|
||||
CREATE TABLE IF NOT EXISTS `config` (
|
||||
`key` VARCHAR(255) NOT NULL,
|
||||
`value` INT(11) NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY(`key`)
|
||||
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
|
1
migrations/2_users.down.sql
Normal file
1
migrations/2_users.down.sql
Normal file
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS users;
|
11
migrations/2_users.up.sql
Normal file
11
migrations/2_users.up.sql
Normal file
|
@ -0,0 +1,11 @@
|
|||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`uuid` BINARY(16) PRIMARY KEY,
|
||||
`username` VARCHAR(64) NOT NULL,
|
||||
`password` VARCHAR(60) NOT NULL,
|
||||
`email` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`verified` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`active` TINYINT(1) NOT NULL DEFAULT 1,
|
||||
`admin` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
KEY `usernameLookup` (`username`, `active`),
|
||||
KEY `emailLookup` (`email`, `active`)
|
||||
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
|
Loading…
Add table
Add a link
Reference in a new issue