From 93d6d36eb697cd9452eb4aab446151a1a33ed245 Mon Sep 17 00:00:00 2001
From: Adam Mathes <adam@trenchant.org>
Date: Mon, 23 Jan 2017 20:04:03 -0800
Subject: neko v2 initial commit

---
 init.sql | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 init.sql

(limited to 'init.sql')

diff --git a/init.sql b/init.sql
new file mode 100644
index 0000000..7b01fda
--- /dev/null
+++ b/init.sql
@@ -0,0 +1,24 @@
+CREATE TABLE feed (
+  id INT NOT NULL AUTO_INCREMENT,
+  url VARCHAR(100) NOT NULL,
+  web_url VARCHAR(100) NOT NULL DEFAULT "",
+  title VARCHAR(100) NOT NULL DEFAULT "",
+  last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  UNIQUE KEY (url),
+  PRIMARY KEY (id)
+);
+
+CREATE TABLE item (
+  id INT NOT NULL AUTO_INCREMENT,
+  feed_id INT NOT NULL,
+  title TEXT,
+  url VARCHAR(100) NOT NULL,
+  description TEXT,
+  publish_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
+  read_state BOOLEAN DEFAULT FALSE NOT NULL,
+  FOREIGN KEY (feed_id) REFERENCES feed(id) ON DELETE CASCADE,
+  UNIQUE KEY (url),
+  INDEX (publish_date),
+  PRIMARY KEY (id)
+);
+
-- 
cgit v1.2.3

