aboutsummaryrefslogtreecommitdiffstats
path: root/sqlite.init.sql
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-06-12 14:58:02 -0700
committerAdam Mathes <adam@trenchant.org>2018-06-12 14:58:02 -0700
commit9e011074bcc80e00e6deb5b914371718e5991ce2 (patch)
treef8e7ef28d53f271354b369a3f5ef0844cd8a7ee6 /sqlite.init.sql
parent968d44abeb1fc378d4ce8e207c9f4983c19eb47a (diff)
downloadneko-9e011074bcc80e00e6deb5b914371718e5991ce2.tar.gz
neko-9e011074bcc80e00e6deb5b914371718e5991ce2.tar.bz2
neko-9e011074bcc80e00e6deb5b914371718e5991ce2.zip
sqlite3 support
Diffstat (limited to 'sqlite.init.sql')
-rw-r--r--sqlite.init.sql30
1 files changed, 30 insertions, 0 deletions
diff --git a/sqlite.init.sql b/sqlite.init.sql
new file mode 100644
index 0000000..d4d08c8
--- /dev/null
+++ b/sqlite.init.sql
@@ -0,0 +1,30 @@
+CREATE TABLE IF NOT EXISTS "feed" (
+ "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ "url" varchar(100) NOT NULL UNIQUE,
+ "web_url" varchar(255) NOT NULL DEFAULT '',
+ "title" varchar(255) NOT NULL DEFAULT '',
+ "last_updated" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "category" varchar(255) NOT NULL DEFAULT 'uncategorized'
+);
+CREATE INDEX "feed_url" ON "feed" ("url");
+CREATE INDEX "feed_category" ON "feed" ("category");
+CREATE INDEX "feed_id" ON "feed" ("id");
+
+CREATE TABLE IF NOT EXISTS "item" (
+ "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ "feed_id" int(11) NOT NULL,
+ "title" text NOT NULL DEFAULT '',
+ "url" varchar(255) NOT NULL UNIQUE,
+ "description" text NOT NULL DEFAULT '',
+ "publish_date" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "read_state" tinyint(1) NOT NULL DEFAULT '0',
+ "starred" tinyint(1) NOT NULL DEFAULT '0',
+ "full_content" text NOT NULL DEFAULT '',
+ "header_image" text NOT NULL DEFAULT '',
+ CONSTRAINT "item_ibfk_1" FOREIGN KEY ("feed_id") REFERENCES "feed" ("id") ON DELETE CASCADE
+);
+CREATE INDEX "item_url" ON "item" ("url");
+CREATE INDEX "item_publish_date" ON "item" ("publish_date");
+CREATE INDEX "item_feed_id" ON "item" ("feed_id");
+CREATE INDEX "item_rev_id" ON "item" ("id");
+CREATE INDEX "item_read_state" ON "item" ("read_state");