~launchpad-pqm/launchpad/devel

7675.818.1 by Steve Kowalik
Add plumbing code for the ability to initialise a distro series from a parent
1
-- Copyright 2009 Canonical Ltd.  This software is licensed under the
2
-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4
SET client_min_messages=ERROR;
5
13194.4.8 by Gavin Panella
These changes could not be landed in devel, so they'll land here.
6
-- The `InitializeDistroSeriesJob` table captures the data required for an ifp job.
7675.818.1 by Steve Kowalik
Add plumbing code for the ability to initialise a distro series from a parent
7
7675.818.6 by Steve Kowalik
* Rename InitialiseDistroSeriesJob to DistributionJob, and pass both a
8
CREATE TABLE DistributionJob (
7675.818.1 by Steve Kowalik
Add plumbing code for the ability to initialise a distro series from a parent
9
    id serial PRIMARY KEY,
10
    -- FK to the `Job` record with the "generic" data about this archive
11
    -- job.
7675.818.6 by Steve Kowalik
* Rename InitialiseDistroSeriesJob to DistributionJob, and pass both a
12
    job integer NOT NULL CONSTRAINT distributionjob__job__fk REFERENCES job,
13
    -- FK to the associated `Distribution` record.
7675.818.7 by Steve Kowalik
* Rename DoDistributionJob to InitialiseDistroSeriesJob.
14
    distribution integer NOT NULL REFERENCES Distribution,
15
    distroseries integer REFERENCES DistroSeries,
7675.818.5 by Steve Kowalik
Re-add job_type
16
    -- The particular type of foo job
17
    job_type integer NOT NULL,
7675.818.1 by Steve Kowalik
Add plumbing code for the ability to initialise a distro series from a parent
18
    -- JSON data for use by the job
19
    json_data text
20
);
21
7675.818.6 by Steve Kowalik
* Rename InitialiseDistroSeriesJob to DistributionJob, and pass both a
22
ALTER TABLE DistributionJob ADD CONSTRAINT distributionjob__job__key UNIQUE (job);
7675.818.8 by Steve Kowalik
* Fix the database constraint.
23
CREATE UNIQUE INDEX distribution_job__initialise_series__distroseries ON DistributionJob (distroseries) WHERE job_type = 1;
7675.818.9 by Steve Kowalik
Switch to the new database number
24
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 10, 0);
7675.818.1 by Steve Kowalik
Add plumbing code for the ability to initialise a distro series from a parent
25