summaryrefslogtreecommitdiffstats
path: root/migrations/2020-06-07-160636_create_user/up.sql
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-06-21 06:37:46 +0200
committerJokler <jokler@protonmail.com>2020-06-21 06:37:46 +0200
commite6468b012d5b33dd16992652da57f11dd5a6e82f (patch)
treee89add440df79d4036b9b44d8c77ee6d69e67201 /migrations/2020-06-07-160636_create_user/up.sql
downloadjoklerpoints-e6468b012d5b33dd16992652da57f11dd5a6e82f.tar.gz
joklerpoints-e6468b012d5b33dd16992652da57f11dd5a6e82f.zip
Initial commitHEADmaster
Diffstat (limited to 'migrations/2020-06-07-160636_create_user/up.sql')
-rw-r--r--migrations/2020-06-07-160636_create_user/up.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/migrations/2020-06-07-160636_create_user/up.sql b/migrations/2020-06-07-160636_create_user/up.sql
new file mode 100644
index 0000000..e0ee7f4
--- /dev/null
+++ b/migrations/2020-06-07-160636_create_user/up.sql
@@ -0,0 +1,13 @@
+CREATE TABLE users (
+ id SERIAL NOT NULL PRIMARY KEY,
+ power_level INTEGER NOT NULL DEFAULT 0,
+ name VARCHAR(32) UNIQUE NOT NULL,
+ created timestamp NOT NULL DEFAULT current_timestamp(),
+ balance bigint UNSIGNED NOT NULL
+);
+
+CREATE TABLE passwords (
+ id SERIAL NOT NULL PRIMARY KEY,
+ hash CHAR(120) BINARY NOT NULL,
+ CONSTRAINT fk_user_id FOREIGN KEY (id) REFERENCES users (id)
+);