~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/patch-2208-64-0.sql

  • Committer: William Grant
  • Date: 2011-06-06 11:09:09 UTC
  • mfrom: (7675.1045.464 db-devel)
  • Revision ID: william.grant@canonical.com-20110606110909-57xmbxl6jxn4ydme
Merge db-stable r10647, resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
-- GNU Affero General Public License version 3 (see the file LICENSE).
 
3
SET client_min_messages=ERROR;
 
4
 
 
5
ALTER TABLE DistroSeriesDifference
 
6
    ADD COLUMN parent_series INTEGER
 
7
        CONSTRAINT distroseriesdifference__parentseries__fk REFERENCES distroseries;
 
8
-- Because of the likelihood of staging and production having existing data,
 
9
-- we need to set it, but only for Ubuntu.
 
10
UPDATE DistroSeriesDifference SET parent_series = (SELECT id from DistroSeries WHERE name = 'sid') FROM Distribution, DistroSeries WHERE Distribution.name = 'ubuntu' AND DistroSeries.id = derived_series AND DistroSeries.distribution = Distribution.id;
 
11
ALTER TABLE DistroSeriesDifference ALTER COLUMN parent_series SET NOT NULL;
 
12
 
 
13
CREATE INDEX distroseriesdifference__parent_series__idx ON DistroSeriesDifference(parent_series);
 
14
 
 
15
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 64, 0);