~launchpad-pqm/launchpad/devel

7675.545.1 by Jonathan Davies
Added database/schema/patch-2207-23-0.sql, unique constaints for distribution
1
-- Copyright 2010 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
6
ALTER TABLE DistributionMirror
7
    ADD COLUMN country_dns_mirror boolean DEFAULT FALSE NOT NULL;
8
9
--- Index for country archive mirrors, one per country.
10
CREATE UNIQUE INDEX distributionmirror__archive__distribution__country__key
11
    ON DistributionMirror(distribution, country, content)
12
    WHERE country_dns_mirror IS TRUE AND content = 1;
13
14
--- Index for country CD image mirrors, one per country.
15
CREATE UNIQUE INDEX distributionmirror__releases__distribution__country__key
16
    ON DistributionMirror(distribution, country, content)
17
    WHERE country_dns_mirror IS TRUE AND content = 2;
18
19
INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 23, 0);