diff options
author | Alexandre Alapetite <alexandre@alapetite.fr> | 2017-03-26 00:01:11 +0100 |
---|---|---|
committer | Alexandre Alapetite <alexandre@alapetite.fr> | 2017-03-26 00:01:11 +0100 |
commit | 22b41f3bfcbd5a54d59789c2cebfda6dc23b7dde (patch) | |
tree | 791c68ecdf3b5fb6816ab82eaed5ce454a81e4dc /app/SQL/install.sql.pgsql.php | |
parent | a513ca9030314dec0f01b3cc147ceaf0c9b14d88 (diff) | |
download | freshrss-22b41f3bfcbd5a54d59789c2cebfda6dc23b7dde.tar.gz freshrss-22b41f3bfcbd5a54d59789c2cebfda6dc23b7dde.zip |
Candidate implementation of defered insertion
https://github.com/FreshRSS/FreshRSS/issues/530
Diffstat (limited to 'app/SQL/install.sql.pgsql.php')
-rw-r--r-- | app/SQL/install.sql.pgsql.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php index 9f4240b98..1a666cb8a 100644 --- a/app/SQL/install.sql.pgsql.php +++ b/app/SQL/install.sql.pgsql.php @@ -32,7 +32,7 @@ $SQL_CREATE_TABLES = array( 'CREATE TABLE IF NOT EXISTS "%1$sentry" ( "id" BIGINT NOT NULL PRIMARY KEY, - "guid" VARCHAR(760) UNIQUE NOT NULL, + "guid" VARCHAR(760) NOT NULL, "title" VARCHAR(255) NOT NULL, "author" VARCHAR(255), "content" TEXT, @@ -54,6 +54,28 @@ $SQL_CREATE_TABLES = array( 'INSERT INTO "%1$scategory" (name) SELECT \'%2$s\' WHERE NOT EXISTS (SELECT id FROM "%1$scategory" WHERE id = 1);', ); +global $SQL_CREATE_TABLE_ENTRYTMP; +$SQL_CREATE_TABLE_ENTRYTMP = array( +'CREATE TABLE IF NOT EXISTS "%1$sentrytmp" ( -- v1.7 + "id" BIGINT NOT NULL PRIMARY KEY, + "guid" VARCHAR(760) NOT NULL, + "title" VARCHAR(255) NOT NULL, + "author" VARCHAR(255), + "content" TEXT, + "link" VARCHAR(1023) NOT NULL, + "date" INT, + "lastSeen" INT DEFAULT 0, + "hash" BYTEA, + "is_read" SMALLINT NOT NULL DEFAULT 0, + "is_favorite" SMALLINT NOT NULL DEFAULT 0, + "id_feed" SMALLINT, + "tags" VARCHAR(1023), + FOREIGN KEY ("id_feed") REFERENCES "%1$sfeed" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE ("id_feed","guid") +);', +'CREATE INDEX %1$sentrytmp_date_index ON "%1$sentrytmp" ("date");', +); + global $SQL_INSERT_FEEDS; $SQL_INSERT_FEEDS = array( 'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) SELECT \'http://freshrss.org/feeds/all.atom.xml\', 1, \'FreshRSS.org\', \'http://freshrss.org/\', \'FreshRSS, a free, self-hostable aggregator…\', 86400 WHERE NOT EXISTS (SELECT id FROM "%1$sfeed" WHERE url = \'http://freshrss.org/feeds/all.atom.xml\');', |