From 9e011074bcc80e00e6deb5b914371718e5991ce2 Mon Sep 17 00:00:00 2001
From: Adam Mathes <adam@trenchant.org>
Date: Tue, 12 Jun 2018 14:58:02 -0700
Subject: sqlite3 support

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

(limited to 'mysql.init.sql')

diff --git a/mysql.init.sql b/mysql.init.sql
new file mode 100644
index 0000000..dbbc310
--- /dev/null
+++ b/mysql.init.sql
@@ -0,0 +1,30 @@
+SET NAMES 'utf8mb4';
+SET CHARACTER SET utf8mb4;
+
+CREATE TABLE feed (
+  id INT NOT NULL AUTO_INCREMENT,
+  url VARCHAR(255) NOT NULL,
+  web_url VARCHAR(255) NOT NULL DEFAULT "",
+  title VARCHAR(255) NOT NULL DEFAULT "",
+  category VARCHAR(255) NOT NULL DEFAULT "uncategorized",
+  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 NOT NULL DEFAULT "",
+  url VARCHAR(255) NOT NULL,
+  description TEXT NOT NULL DEFAULT "",
+  full_content TEXT NOT NULL DEFAULT "",
+  header_image TEXT NOT NULL DEFAULT "",
+  publish_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
+  read_state BOOLEAN DEFAULT FALSE NOT NULL,
+  starred 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

