Merge ~lgp171188/launchpad:merge-db-stable into launchpad:master

Proposed by Guruprasad
Status: Merged
Approved by: Guruprasad
Approved revision: 96f81be7d884373624d09b67e040db0adb3f2177
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~lgp171188/launchpad:merge-db-stable
Merge into: launchpad:master
Diff against target: 30 lines (+24/-0)
1 file modified
database/schema/patch-2210-38-0.sql (+24/-0)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+414414@code.launchpad.net

Commit message

Merge 'db-stable' 7ab4bd7a744a92db22cf372769485eb5930c7a44

Add 'lock_status' and 'lock_reason' fields to Bug

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

Self-approving because this change has already been deployed to production via the db-stable branch and verified to work okay.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/database/schema/patch-2210-38-0.sql b/database/schema/patch-2210-38-0.sql
0new file mode 1006440new file mode 100644
index 0000000..eef88ec
--- /dev/null
+++ b/database/schema/patch-2210-38-0.sql
@@ -0,0 +1,24 @@
1-- Copyright 2022 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6ALTER TABLE Bug
7 ADD COLUMN lock_status integer,
8 ADD COLUMN lock_reason text;
9
10-- ALTER COLUMN ... SET DEFAULT doesn't trigger a table rewrite,
11-- while ADD COLUMN ... DEFAULT xx does. In pg <11 this operation is slow.
12-- That's why we first create, and then we set the default value.
13-- Data backfilling will be done in a garbo job instead of a fast downtime.
14
15ALTER TABLE Bug
16 ALTER COLUMN lock_status
17 -- 0 = UNLOCKED
18 SET DEFAULT 0;
19
20COMMENT ON COLUMN Bug.lock_status IS 'The current lock status of this bug.';
21
22COMMENT ON COLUMN Bug.lock_reason IS 'The reason for locking this bug.';
23
24INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 38, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: