Merge lp:~stevenk/launchpad/db-searchables-not-null-for-pu into lp:launchpad/db-devel

Proposed by Steve Kowalik
Status: Merged
Approved by: Stuart Bishop
Approved revision: no longer in the source branch.
Merged at revision: 12235
Proposed branch: lp:~stevenk/launchpad/db-searchables-not-null-for-pu
Merge into: lp:launchpad/db-devel
Diff against target: 14 lines (+10/-0)
1 file modified
database/schema/patch-2209-40-3.sql (+10/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-searchables-not-null-for-pu
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Review via email: mp+140135@code.launchpad.net

Commit message

Set PackageUpload.searchable_{name,version}s to NOT NULL.

Description of the change

Now that PackageUpload.searchable_names and searchable_versions are populated and we're about to start relying on them, let's set them to NOT NULL. PostgreSQL seems to ignore indicies when setting NOT NULL, so this patch will take roughly 2 seconds to apply, which is also why both columns are done in one statement.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Fine

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-40-3.sql'
2--- database/schema/patch-2209-40-3.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-40-3.sql 2012-12-17 04:21:22 +0000
4@@ -0,0 +1,10 @@
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 packageupload
11+ ALTER COLUMN searchable_names SET NOT NULL,
12+ ALTER COLUMN searchable_versions SET NOT NULL;
13+
14+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 40, 3);

Subscribers

People subscribed via source and target branches

to status/vote changes: