Review: Approve db
Two points on this patch.

Its usually better to combine ALTER TABLE statements into a single statement 
(when possible), to avoid unnecessary rewrites on the table and the bloat this 
causes. In this case it doesn't really matter, as there are 0 rows in this 
table on production.

The indexes should use the name of the table they are attached too as a prefix 
- you are using unrelated table names. The prefix sucks, but we need it as the 
indexes all share a common namespace.

The following version is approved as patch-2208-55-0.sql:

-- Copyright 2011 Canonical Ltd. This software is licensed under the
-- GNU Affero General Public License version 3 (see the file LICENSE).

SET client_min_messages=ERROR;

-- Convert DistroSeriesDifference source_version, parent_source_version,
-- and base_version types to debversion.

-- Change types.
ALTER TABLE DistroSeriesDifference
    ALTER COLUMN source_version TYPE debversion,
    ALTER COLUMN parent_source_version TYPE debversion,
    ALTER COLUMN base_version TYPE debversion;

-- Create indexes.
CREATE INDEX distroseriesdifference__source_version__idx
    ON DistroSeriesDifference(source_version);
CREATE INDEX distroseriesdifference__parent_source_version__idx
    ON DistroSeriesDifference(parent_source_version);
CREATE INDEX distroseriesdifference__base_version__idx
    ON DistroSeriesDifference(base_version);

INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 55, 0);
-- 
https://code.launchpad.net/~rvb/launchpad/db-dds-diffpage-form/+merge/53913
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~rvb/launchpad/db-dds-diffpage-form into lp:launchpad/db-devel.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to