launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24235
[Merge] ~pappacena/launchpad:db-patch-archive-queue-audit-trail into launchpad:db-devel
Thiago F. Pappacena has proposed merging ~pappacena/launchpad:db-patch-archive-queue-audit-trail into launchpad:db-devel.
Commit message:
Creation of database table for PackageUploadLog
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #885739 in Launchpad itself: "queue and override manipulations should have an audit trail"
https://bugs.launchpad.net/launchpad/+bug/885739
For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/377716
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:db-patch-archive-queue-audit-trail into launchpad:db-devel.
diff --git a/database/schema/patch-2210-11-0.sql b/database/schema/patch-2210-11-0.sql
new file mode 100644
index 0000000..76423ff
--- /dev/null
+++ b/database/schema/patch-2210-11-0.sql
@@ -0,0 +1,25 @@
+-- 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 TABLE packageuploadlog (
+ id serial PRIMARY KEY,
+ package_upload integer NOT NULL REFERENCES packageupload,
+ date_created timestamp without time zone NOT NULL
+ DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
+ person integer NULL REFERENCES person,
+ old_status integer NOT NULL,
+ new_status integer NOT NULL,
+ comment text
+);
+
+CREATE INDEX packageuploadlog__package_upload__date_created__idx
+ ON packageuploadlog(package_upload, date_created);
+
+CREATE INDEX packageuploadlog__person__idx ON packageuploadlog(person);
+
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 11, 0);
+