summaryrefslogtreecommitdiffstats
path: root/migrations/2020-06-23-134455_create_users
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-06-23 16:26:07 +0200
committerJokler <jokler@protonmail.com>2020-06-23 16:26:07 +0200
commitfc7bd403bf41d724bd8dc3bf3b827c592c539171 (patch)
tree1b816f68f1793dc8bf70e490196da6ae58d6f16a /migrations/2020-06-23-134455_create_users
downloadrgit-master.tar.gz
rgit-master.zip
Initial commitHEADmaster
Diffstat (limited to 'migrations/2020-06-23-134455_create_users')
-rw-r--r--migrations/2020-06-23-134455_create_users/down.sql1
-rw-r--r--migrations/2020-06-23-134455_create_users/up.sql7
2 files changed, 8 insertions, 0 deletions
diff --git a/migrations/2020-06-23-134455_create_users/down.sql b/migrations/2020-06-23-134455_create_users/down.sql
new file mode 100644
index 0000000..cc1f647
--- /dev/null
+++ b/migrations/2020-06-23-134455_create_users/down.sql
@@ -0,0 +1 @@
+DROP TABLE users;
diff --git a/migrations/2020-06-23-134455_create_users/up.sql b/migrations/2020-06-23-134455_create_users/up.sql
new file mode 100644
index 0000000..1f472d2
--- /dev/null
+++ b/migrations/2020-06-23-134455_create_users/up.sql
@@ -0,0 +1,7 @@
+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(),
+ hash CHAR(120) BINARY NOT NULL
+);