Merge lp:~cjwatson/launchpad/db-pocket-permissions into lp:launchpad/db-devel

Proposed by Colin Watson on 2012-05-17
Status: Merged
Approved by: Richard Harding on 2012-05-17
Approved revision: no longer in the source branch.
Merged at revision: 11604
Proposed branch: lp:~cjwatson/launchpad/db-pocket-permissions
Merge into: lp:launchpad/db-devel
Diff against target: 18 lines (+14/-0)
1 file modified
database/schema/patch-2209-18-1.sql (+14/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-pocket-permissions
Reviewer Review Type Date Requested Status
Stuart Bishop db 2012-05-17 Approve on 2012-05-17
Robert Collins db 2012-05-17 Pending
Review via email: mp+106091@code.launchpad.net

This proposal supersedes a proposal from 2012-05-17.

Commit Message

Add ArchivePermission.pocket column.

Description of the Change

== Summary ==

Bug 914779 requests per-pocket upload permissions. This is tied in with getting rid of archive admin shell access, as one of the steps there involves sorting out the ubuntu-security team's processes and they currently rely on all sorts of weird hacks, including a celebrity, to make sure they can publish security updates in a timely fashion; it would also make life easier for the Ubuntu backporters team.

== Proposed fix ==

This is the DB part of the fix, adding a pocket column to ArchivePermission in more or less the obvious way, and adjusting the constraint to match (we're not interested in any of the cases where you might want intersected permissions such as component+pocket, as far as I can make out). There's some fiddling to sort out the constraint since PostgreSQL lacks MODIFY CONSTRAINT, but wgrant reckons this approach should be OK on a relatively small table such as ArchivePermission.

To post a comment you must log in.
Stuart Bishop (stub) wrote :

This looks fine.There are no problems with dropping and recreating the table as there are only 800 rows to check.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-18-1.sql'
2--- database/schema/patch-2209-18-1.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-18-1.sql 2012-05-17 02:59:27 +0000
4@@ -0,0 +1,14 @@
5+-- Copyright 2012 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE ArchivePermission DROP CONSTRAINT one_target;
11+
12+ALTER TABLE ArchivePermission ADD COLUMN pocket INTEGER;
13+
14+ALTER TABLE ArchivePermission ADD CONSTRAINT one_target CHECK ((null_count(ARRAY[packageset, component, sourcepackagename, pocket]) = 3));
15+
16+COMMENT ON COLUMN ArchivePermission.pocket IS 'The pocket to which this permission applies.';
17+
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 18, 1);

Subscribers

People subscribed via source and target branches

to status/vote changes: