diff options
author | LarsVomMars | 2020-07-30 20:03:19 +0200 |
---|---|---|
committer | LarsVomMars | 2020-07-30 20:03:19 +0200 |
commit | 14aea28ac22e5d2e9e510c5986daca1bef1c43ae (patch) | |
tree | 7d117c9aacd2fff312f4df39373d5bc57c3b58be /src/db/tables.sql | |
parent | f5f651d5180ddd12c57288d534129c8b00ff3162 (diff) |
Added some more user db functions
Diffstat (limited to 'src/db/tables.sql')
-rw-r--r-- | src/db/tables.sql | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/db/tables.sql b/src/db/tables.sql index a0c9eef..a7c3838 100644 --- a/src/db/tables.sql +++ b/src/db/tables.sql @@ -1,19 +1,23 @@ # DROP TABLE IF EXISTS access; # DROP TABLE IF EXISTS users; -CREATE TABLE IF NOT EXISTS users ( - id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, - email VARCHAR(48) NOT NULL UNIQUE, - username VARCHAR(24) NOT NULL UNIQUE, - password VARCHAR(64) NOT NULL, +CREATE TABLE IF NOT EXISTS users +( + id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + email VARCHAR(48) NOT NULL UNIQUE, + username VARCHAR(24) NOT NULL UNIQUE, + password VARCHAR(64) NOT NULL, verification VARCHAR(64) NOT NULL UNIQUE, - dark_theme BOOLEAN NOT NULL DEFAULT true, - is_admin BOOLEAN NOT NULL DEFAULT false -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + dark_theme BOOLEAN NOT NULL DEFAULT true, + is_admin BOOLEAN NOT NULL DEFAULT false +) ENGINE = InnoDB + DEFAULT CHARSET = utf8; -CREATE TABLE IF NOT EXISTS access ( - id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, - uid INT(6) UNSIGNED, +CREATE TABLE IF NOT EXISTS access +( + id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + uid INT(6) UNSIGNED, path VARCHAR(64) NOT NULL, - FOREIGN KEY (uid) REFERENCES users(id) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + FOREIGN KEY (uid) REFERENCES users (id) ON DELETE CASCADE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8; |