From 032dd53bc45d4e387568161d70f0beeddab7cfef Mon Sep 17 00:00:00 2001 From: Mark Huot Date: Mon, 21 Dec 2020 15:53:16 -0500 Subject: [PATCH] adds uid_urlhash_idx on installation to support without this Postgres will complain that "ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification" with the following SQL, INSERT INTO "upper_cache" ("urlHash", "url", "tags", "headers", "siteId", "dateCreated", "dateUpdated", "uid") VALUES ($1, $2, ARRAY[]::varchar[], $3, $4, $5, $6, $7) ON CONFLICT ("uid", "urlHash") DO UPDATE SET "urlHash"=$8, "url"=$9, "tags"=ARRAY[]::varchar[], "headers"=$10, "siteId"=$11, "dateCreated"=$12, "dateUpdated"=$13, "uid"=$14 --- src/migrations/Install.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/migrations/Install.php b/src/migrations/Install.php index e92b629..cf03bf4 100644 --- a/src/migrations/Install.php +++ b/src/migrations/Install.php @@ -53,6 +53,7 @@ public function safeUp() echo " > Create index: urlhash_idx" . PHP_EOL; $this->createIndex('urlhash_idx', Plugin::CACHE_TABLE, 'urlHash', true); + $this->createIndex('uid_urlhash_ids', Plugin::CACHE_TABLE, 'uid,urlHash', true); $this->execute("CREATE INDEX tags_array ON " . Plugin::CACHE_TABLE . " USING GIN(tags)");