Merge lp:~maxiberta/launchpad/db-named-auth-tokens into lp:launchpad/db-devel

Proposed by Maximiliano Bertacchini
Status: Merged
Merged at revision: 13498
Proposed branch: lp:~maxiberta/launchpad/db-named-auth-tokens
Merge into: lp:launchpad/db-devel
Diff against target: 18 lines (+14/-0)
1 file modified
database/schema/patch-2209-79-0.sql (+14/-0)
To merge this branch: bzr merge lp:~maxiberta/launchpad/db-named-auth-tokens
Reviewer Review Type Date Requested Status
Colin Watson (community) db Approve
Launchpad code reviewers db Pending
Review via email: mp+299433@code.launchpad.net

Commit message

Add ArchiveAuthToken.name; make ArchiveAuthToken.person nullable.

Description of the change

Add ArchiveAuthToken.name; make ArchiveAuthToken.person nullable. This is needed by the new named auth token API required for UA customer delivery of kernel livepatches. See https://code.launchpad.net/~maxiberta/launchpad/named-auth-tokens/+merge/299432.

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

Fixed the new ArchiveAuthToken index based on analysis of query execution plan. Thanks!

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Added unique constraint on ArchiveAuthToken(archive,name).

Revision history for this message
Colin Watson (cjwatson) :
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-79-0.sql'
2--- database/schema/patch-2209-79-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-79-0.sql 2016-07-12 14:55:01 +0000
4@@ -0,0 +1,14 @@
5+-- Copyright 2016 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 ArchiveAuthToken
11+ ALTER COLUMN person DROP NOT NULL,
12+ ADD COLUMN name text;
13+
14+COMMENT ON COLUMN ArchiveAuthToken.name IS 'The name for this named token.';
15+
16+CREATE UNIQUE INDEX archiveauthtoken__archive__name__date_deactivated__idx ON ArchiveAuthToken(archive, name) WHERE date_deactivated IS NULL AND name IS NOT NULL;
17+
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 79, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: