1
-- Copyright 2011 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 PackagingJob
7
potemplate INTEGER DEFAULT NULL
8
CONSTRAINT potemplate_fk REFERENCES POTemplate;
10
ALTER TABLE PackagingJob
11
ALTER COLUMN productseries DROP NOT NULL,
12
ALTER COLUMN distroseries DROP NOT NULL,
13
ALTER COLUMN sourcepackagename DROP NOT NULL,
14
ADD CONSTRAINT translationtemplatejob_valid_link CHECK (
15
-- If there is a template, it is the template being moved.
16
(potemplate IS NOT NULL AND productseries IS NULL AND
17
distroseries IS NULL AND sourcepackagename IS NULL) OR
18
-- If there is no template, we need all of productseries, distroseries
19
-- and sourcepackagename because we are moving translations between
20
-- a productseries and a source package.
21
(potemplate IS NULL AND productseries IS NOT NULL AND
22
distroseries IS NOT NULL AND sourcepackagename IS NOT NULL));
24
CREATE INDEX packagingjob__potemplate__idx ON PackagingJob (potemplate);
26
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 79, 1);