From: Steinar H. Gunderson Date: Fri, 5 Feb 2016 11:00:34 +0000 (+0100) Subject: Flip the order of the fields in the exif_info primary key again; we need to delete... X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=8e5ec72d5a96e0828d61cd74d27cfa3725d337db;hp=12e2d43c7d68a328e9c6e3ff2f3810d3b6799b47 Flip the order of the fields in the exif_info primary key again; we need to delete based on image sometimes. Sadly reduces the usefulness of the clustering. --- diff --git a/sql/pr0n.sql b/sql/pr0n.sql index 4729a37..371e05c 100644 --- a/sql/pr0n.sql +++ b/sql/pr0n.sql @@ -77,7 +77,7 @@ CREATE TABLE exif_info ( key varchar NOT NULL, value varchar NOT NULL, - PRIMARY KEY ( key, image ) + PRIMARY KEY ( image, key ) ); CLUSTER exif_info_pkey ON exif_info; diff --git a/sql/upgrade-v3.11.sql b/sql/upgrade-v3.11.sql index 8f066aa..94884d8 100644 --- a/sql/upgrade-v3.11.sql +++ b/sql/upgrade-v3.11.sql @@ -11,5 +11,4 @@ alter table deleted_images add column render_id integer; drop index exif_info_key; alter table exif_info drop constraint exif_info_pkey; -alter table exif_info create primary key ( key, image ); -cluster exif_info_pkey on exif_info; +alter table exif_info add primary key ( image, key );