launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24823
[Merge] ~pappacena/launchpad:hot-gitrepo-status-column into launchpad:master
Thiago F. Pappacena has proposed merging ~pappacena/launchpad:hot-gitrepo-status-column into launchpad:master.
Commit message:
Hot patch to add index, default value and NOT NULL constraint to GitRepository.status.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/385198
This database patch should be applied "hot", with CONCURRENTLY on the index creation, after the MP https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/385199 is landed.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:hot-gitrepo-status-column into launchpad:master.
diff --git a/database/schema/patch-2210-17-1.sql b/database/schema/patch-2210-17-1.sql
new file mode 100644
index 0000000..1853952
--- /dev/null
+++ b/database/schema/patch-2210-17-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 gitrepository__status__idx ON GitRepository (status);
+
+ALTER TABLE GitRepository
+ ALTER COLUMN status
+ SET DEFAULT 1,
+ ALTER COLUMN status SET NOT NULL;
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 17, 1);
Follow ups