Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
adds uid_urlhash_idx on installation to support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markhuot authored and Oliver Stark committed Jan 26, 2021
1 parent b25a3b7 commit 032dd53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)");

Expand Down

0 comments on commit 032dd53

Please sign in to comment.