From 5f42c8ab667fa421edcc09e693aeda1d2688d76f Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 17 Jul 2018 02:16:46 +0100 Subject: [PATCH] lib/postgres/website.sql --- lib/postgres/article.sql | 17 ----------------- lib/postgres/link.sql | 10 ---------- 2 files changed, 27 deletions(-) delete mode 100644 lib/postgres/article.sql delete mode 100644 lib/postgres/link.sql diff --git a/lib/postgres/article.sql b/lib/postgres/article.sql deleted file mode 100644 index abefe059..00000000 --- a/lib/postgres/article.sql +++ /dev/null @@ -1,17 +0,0 @@ ---DROP TABLE IF EXISTS article; -CREATE TABLE IF NOT EXISTS article ( - url varchar(200) PRIMARY KEY, - website varchar(200), - title varchar(200), - date timestamp, - content varchar(10000), - enable BOOLEAN DEFAULT 'f' -); -CREATE TEMPORARY TABLE _article AS SELECT * FROM article LIMIT 0; -BEGIN TRANSACTION; -DELETE FROM _article; -COPY _article FROM PROGRAM '. /etc/profile && psql data -Atc "select rss from website where rss_on" \ -| xargs -n 1 rss-feedparser | sed "s/\$/\tf/" -' WITH (format 'text', NULL ''); -INSERT INTO article SELECT * FROM _article ON CONFLICT (url) DO NOTHING; -COMMIT; diff --git a/lib/postgres/link.sql b/lib/postgres/link.sql deleted file mode 100644 index 1d5d7c27..00000000 --- a/lib/postgres/link.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS link; -CREATE TABLE IF NOT EXISTS link ( - link VARCHAR(500) PRIMARY KEY, - title VARCHAR(250) NOT NULL, - description VARCHAR(250) NOT NULL, - created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - enable BOOLEAN DEFAULT 'f' -); - -CREATE INDEX IF NOT EXISTS link_created ON link USING btree (created); -- 2.47.3