aboutsummaryrefslogtreecommitdiffstats
path: root/init.sql
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-01-23 20:04:03 -0800
committerAdam Mathes <adam@trenchant.org>2017-01-23 20:04:03 -0800
commit93d6d36eb697cd9452eb4aab446151a1a33ed245 (patch)
treec9cb88718d03a6964f6d3705066f11d356257d37 /init.sql
downloadneko-93d6d36eb697cd9452eb4aab446151a1a33ed245.tar.gz
neko-93d6d36eb697cd9452eb4aab446151a1a33ed245.tar.bz2
neko-93d6d36eb697cd9452eb4aab446151a1a33ed245.zip
neko v2 initial commit
Diffstat (limited to 'init.sql')
-rw-r--r--init.sql24
1 files changed, 24 insertions, 0 deletions
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)
+);
+