← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:db-xpph-datepublished into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:db-xpph-datepublished into launchpad:master.

Commit message:
Add xPPH indexes where datepublished is NULL

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): db
Related bugs:
  Bug #1868558 in Launchpad itself: "Honour Built-Using field"
  https://bugs.launchpad.net/launchpad/+bug/1868558

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/383880

These will be useful for upcoming publisher changes that use `datepublished IS NULL` rather than `status = PENDING` to decide whether publication records need to have their files published to disk.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:db-xpph-datepublished into launchpad:master.
diff --git a/database/schema/patch-2210-13-1.sql b/database/schema/patch-2210-13-1.sql
new file mode 100644
index 0000000..b054b18
--- /dev/null
+++ b/database/schema/patch-2210-13-1.sql
@@ -0,0 +1,13 @@
+-- Copyright 2020 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+CREATE INDEX sourcepackagepublishinghistory__archive__status__datepublished__idx
+    ON SourcePackagePublishingHistory (archive, status)
+    WHERE datepublished IS NULL;
+CREATE INDEX binarypackagepublishinghistory__archive__status__datepublished__idx
+    ON BinaryPackagePublishingHistory (archive, status)
+    WHERE datepublished IS NULL;
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 13, 1);