2020-02-01 14:52:27 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS user (
|
2020-01-31 15:22:58 +01:00
|
|
|
user_id int NOT NULL AUTO_INCREMENT,
|
2020-02-09 21:25:33 +01:00
|
|
|
username varchar(256) NOT NULL UNIQUE,
|
|
|
|
password varchar(256) NOT NULL,
|
2020-01-31 17:36:48 +01:00
|
|
|
root_path varchar(512),
|
|
|
|
admin boolean NOT NULL DEFAULT 0,
|
2020-01-31 15:22:58 +01:00
|
|
|
|
|
|
|
PRIMARY KEY (user_id)
|
|
|
|
);
|
2020-01-31 18:51:24 +01:00
|
|
|
|
2020-02-01 14:52:27 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS access_token (
|
2020-01-31 18:51:24 +01:00
|
|
|
token_id int NOT NULL AUTO_INCREMENT,
|
|
|
|
user_id int NOT NULL,
|
|
|
|
value char(24) NOT NULL UNIQUE,
|
|
|
|
expire timestamp NOT NULL,
|
|
|
|
|
|
|
|
PRIMARY KEY (token_id),
|
2020-02-12 18:10:52 +01:00
|
|
|
FOREIGN KEY (user_id) REFERENCES user(user_id) ON DELETE CASCADE
|
2020-01-31 18:51:24 +01:00
|
|
|
);
|