Merge ~twom/launchpad:add-affirmation-code-of-conduct into launchpad:db-devel

Proposed by Tom Wardill
Status: Merged
Approved by: Tom Wardill
Approved revision: 2f2ae7669d194f20054fe783108020493cbd8ce8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~twom/launchpad:add-affirmation-code-of-conduct
Merge into: launchpad:db-devel
Diff against target: 21 lines (+15/-0)
1 file modified
database/schema/patch-2210-34-0.sql (+15/-0)
Reviewer Review Type Date Requested Status
William Grant db Approve
Colin Watson (community) db Approve
Review via email: mp+406293@code.launchpad.net

Commit message

Add affirmed column to signedcodeofconduct

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Needs Fixing
Revision history for this message
Tom Wardill (twom) :
Revision history for this message
Colin Watson (cjwatson) wrote :

LGTM, but let's get a quick DB review from William as usual.

review: Approve (db)
Revision history for this message
Colin Watson (cjwatson) wrote :

Hm, I wonder whether we should also have a constraint something like `NOT affirmed OR signing_key_fingerprint IS NULL`? We probably don't want both those things to be set.

Revision history for this message
Colin Watson (cjwatson) :
review: Approve (db)
Revision history for this message
William Grant (wgrant) :
review: Approve (db)
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/database/schema/patch-2210-34-0.sql b/database/schema/patch-2210-34-0.sql
2new file mode 100644
3index 0000000..fe97a37
4--- /dev/null
5+++ b/database/schema/patch-2210-34-0.sql
6@@ -0,0 +1,15 @@
7+-- Copyright 2021 Canonical Ltd. This software is licensed under the
8+-- GNU Affero General Public License version 3 (see the file LICENSE).
9+
10+SET client_min_messages=ERROR;
11+
12+ALTER TABLE signedcodeofconduct
13+ ADD COLUMN affirmed boolean,
14+ ADD COLUMN version text;
15+
16+ALTER TABLE signedcodeofconduct ADD CONSTRAINT only_one_method CHECK (NOT affirmed OR signing_key_fingerprint IS NULL);
17+
18+COMMENT ON COLUMN signedcodeofconduct.affirmed IS 'Code of conduct was affirmed via website interaction.';
19+COMMENT ON COLUMN signedcodeofconduct.version IS 'Version of the Code of Conduct that was signed.';
20+
21+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 34, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: