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;
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;
13
CREATE INDEX distroseriesdifference__parent_series__idx ON DistroSeriesDifference(parent_series);
15
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 64, 0);