← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:db-patch-change-override-log into launchpad:db-devel

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:db-patch-change-override-log into launchpad:db-devel.

Commit message:
Adding 'creator' column (and index) to BinaryPackagePublishingHistory (SourcePackagePublishingHistory already the same column and index).

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/380254
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:db-patch-change-override-log into launchpad:db-devel.
diff --git a/database/schema/patch-2210-12-0.sql b/database/schema/patch-2210-12-0.sql
new file mode 100644
index 0000000..aa9b9c9
--- /dev/null
+++ b/database/schema/patch-2210-12-0.sql
@@ -0,0 +1,23 @@
+-- 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;
+
+
+ALTER TABLE binarypackagepublishinghistory
+    ADD COLUMN creator INT REFERENCES person;
+
+CREATE INDEX binarypackagepublishinghistory__creator__idx ON
+    binarypackagepublishinghistory(creator) WHERE creator IS NOT NULL;
+
+
+ALTER TABLE binarypackagepublishinghistory
+    ADD COLUMN copied_from_archive INT REFERENCES archive;
+
+
+ALTER TABLE sourcepackagepublishinghistory
+    ADD COLUMN copied_from_archive INT REFERENCES archive;
+
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 12, 0);
+