From 47f66e980761ad1218f51c7f51e51dd550bf0b35 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Sat, 18 Jul 2020 15:54:13 +0200
Subject: Data, data, daaaaaaaaataaaaaaaaaaaa!

---
 src/db/tables.sql | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

(limited to 'src/db/tables.sql')

diff --git a/src/db/tables.sql b/src/db/tables.sql
index 4523522..9883ea1 100644
--- a/src/db/tables.sql
+++ b/src/db/tables.sql
@@ -1,5 +1,19 @@
-DROP TABLE IF EXISTS test;
+DROP TABLE IF EXISTS access;
+DROP TABLE IF EXISTS users;
 
-CREATE TABLE IF NOT EXISTS test (
-    id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY
+CREATE TABLE IF NOT EXISTS users (
+    id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
+    email VARCHAR(24) 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;
+
+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;
-- 
cgit v1.2.3

