7675.402.1
by Muharem Hrnjadovic
Schema patch complete. |
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 |
||
6 |
-- The schema patch required for the Soyuz buildd generalisation, see
|
|
7 |
-- https://dev.launchpad.net/Soyuz/Specs/BuilddGeneralisation for details.
|
|
8 |
-- Bug #485524.
|
|
9 |
||
10 |
-- Please note : this change is needed in order to estimate build farm job
|
|
11 |
-- dispatch times irrespective of the job type.
|
|
12 |
||
13 |
-- Step 1
|
|
14 |
-- Add an estimated duration column to the `BuildQueue` table first.
|
|
15 |
ALTER TABLE ONLY buildqueue |
|
16 |
ADD COLUMN estimated_duration interval NOT NULL DEFAULT '0 sec'; |
|
17 |
||
18 |
-- Step 2
|
|
19 |
-- Migrate the estimated duration values from the `Build` table.
|
|
20 |
UPDATE buildqueue |
|
21 |
SET estimated_duration = build.estimated_build_duration |
|
22 |
FROM buildpackagejob, build |
|
23 |
WHERE
|
|
24 |
buildqueue.job = buildpackagejob.job |
|
25 |
AND buildpackagejob.build = build.id |
|
26 |
AND build.estimated_build_duration IS NOT NULL; |
|
27 |
||
28 |
-- Step 3
|
|
29 |
-- Drop the obsolete 'estimated_build_duration' column from the `Build` table.
|
|
30 |
ALTER TABLE ONLY build DROP COLUMN estimated_build_duration; |
|
31 |
||
7675.402.2
by Muharem Hrnjadovic
Switching to new schema patch number assigned by Stuart. |
32 |
INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 14, 0); |