From b9281c89737419216b710a87c31686d21adf86bc Mon Sep 17 00:00:00 2001
From: Nicolas Sterchele <nicolas@sterchelen.net>
Date: Wed, 31 Aug 2022 23:08:52 +0200
Subject: initial commit

Thanks to Ted Unangst for its work.
Originally available here https://humungus.tedunangst.com/r/inks
---
 schema.sql | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 schema.sql

(limited to 'schema.sql')

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);
+
-- 
cgit v1.2.3

