From 0eb7a717e61ecce6a7a5c8484e42268b4904a79c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 15 Oct 2016 00:04:51 +0200 Subject: PostgreSQL avoid duplicate category 1 https://github.com/FreshRSS/FreshRSS/issues/1312 --- app/SQL/install.sql.pgsql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/SQL/install.sql.pgsql.php') diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php index 841003def..6e1d4a103 100644 --- a/app/SQL/install.sql.pgsql.php +++ b/app/SQL/install.sql.pgsql.php @@ -51,7 +51,7 @@ $SQL_CREATE_TABLES = array( 'CREATE INDEX %1$sis_read_index ON "%1$sentry" ("is_read");', 'CREATE INDEX %1$sentry_lastSeen_index ON "%1$sentry" ("lastSeen");', -'INSERT INTO "%1$scategory" (id, name) VALUES(1, \'%2$s\');', +'INSERT INTO "%1$scategory" (id, name) SELECT 1, \'%2$s\' WHERE NOT EXISTS (SELECT id FROM "%1$scategory" WHERE id = 1);', 'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) VALUES(\'http://freshrss.org/feeds/all.atom.xml\', 1, \'FreshRSS.org\', \'http://freshrss.org/\', \'FreshRSS, a free, self-hostable aggregator…\', 86400);', 'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) VALUES(\'https://github.com/FreshRSS/FreshRSS/releases.atom\', 1, \'FreshRSS @ GitHub\', \'https://github.com/FreshRSS/FreshRSS/\', \'FreshRSS releases @ GitHub\', 86400);', ); -- cgit v1.2.3