aboutsummaryrefslogtreecommitdiff
path: root/db/user/init.sql
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-28 23:59:50 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-28 23:59:50 +0200
commit67dbb6421976254658c5e38045513129dd18187a (patch)
tree288b599d1097b26bdbcad3b6749b38e133017cf2 /db/user/init.sql
initial public commit
Diffstat (limited to 'db/user/init.sql')
-rw-r--r--db/user/init.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/user/init.sql b/db/user/init.sql
new file mode 100644
index 0000000..1d0e830
--- /dev/null
+++ b/db/user/init.sql
@@ -0,0 +1,16 @@
+create table if not exists user (
+ id integer primary key autoincrement,
+ username text not null,
+ unique(username)
+);
+
+create table if not exists sort_overlay (
+ id integer primary key autoincrement,
+ user_id int not null default 0,
+ expression text not null,
+ reading text not null,
+ sort int not null,
+ foreign key(user_id) references user(id),
+ unique(user_id, expression, reading) on conflict replace
+);
+