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