summaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
authorNicolas Sterchele <nicolas@sterchelen.net>2022-08-31 23:08:52 +0200
committerNicolas Sterchele <nicolas@sterchelen.net>2022-08-31 23:19:58 +0200
commitb9281c89737419216b710a87c31686d21adf86bc (patch)
treebc2b2c73b35ead61bee37b75aec1eee2d78c6ef4 /schema.sql
initial commit
Thanks to Ted Unangst for its work. Originally available here https://humungus.tedunangst.com/r/inks
Diffstat (limited to 'schema.sql')
-rwxr-xr-xschema.sql22
1 files changed, 22 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
new file mode 100755
index 0000000..e9fec23
--- /dev/null
+++ b/schema.sql
@@ -0,0 +1,22 @@
+
+create table links(linkid integer primary key, textid integer, url text, dt text, source text, site text);
+create virtual table linktext using fts4 (title, summary, remnants);
+create table tags (tagid integer primary key, linkid integer, tag text);
+create table sources (sourceid integer primary key, name text, notes text);
+
+create table followers(followerid integer primary key, url text);
+
+create index idx_linkstextid on links(textid);
+create index idx_linkssite on links(site);
+create index idx_linkssource on links(source);
+create index idx_tagstag on tags(tag);
+create index idx_tagslinkid on tags(linkid);
+
+CREATE TABLE config (key text, value text);
+
+CREATE TABLE users (userid integer primary key, username text, hash text);
+CREATE TABLE auth (authid integer primary key, userid integer, hash text, expiry text);
+CREATE INDEX idxusers_username on users(username);
+CREATE INDEX idxauth_userid on auth(userid);
+CREATE INDEX idxauth_hash on auth(hash);
+