Merge lp:~wgrant/launchpad/multiproc-builders-db into lp:launchpad/db-devel

Proposed by William Grant
Status: Merged
Merged at revision: 12574
Proposed branch: lp:~wgrant/launchpad/multiproc-builders-db
Merge into: lp:launchpad/db-devel
Prerequisite: lp:launchpad
Diff against target: 62 lines (+36/-0)
3 files modified
database/sampledata/current-dev.sql (+9/-0)
database/sampledata/current.sql (+9/-0)
database/schema/patch-2209-52-0.sql (+18/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/multiproc-builders-db
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Review via email: mp+197013@code.launchpad.net

Commit message

Add a builderprocessor table to let builders acquire candidates of multiple architectures.

Description of the change

This branch adds a BuilderProcessor table, replacing Builder.processor with a many-to-many relation to handle eg. the PPA i386/amd64/lpia/armel/armhf hybrid builders.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

All fine.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/sampledata/current-dev.sql'
2--- database/sampledata/current-dev.sql 2013-11-28 06:45:20 +0000
3+++ database/sampledata/current-dev.sql 2013-11-28 06:45:20 +0000
4@@ -3718,6 +3718,15 @@
5 ALTER TABLE bugwatchactivity ENABLE TRIGGER ALL;
6
7
8+ALTER TABLE builderprocessor DISABLE TRIGGER ALL;
9+
10+INSERT INTO builderprocessor (builder, processor) VALUES (1, 1);
11+INSERT INTO builderprocessor (builder, processor) VALUES (2, 1);
12+
13+
14+ALTER TABLE builderprocessor ENABLE TRIGGER ALL;
15+
16+
17 ALTER TABLE buildpackagejob DISABLE TRIGGER ALL;
18
19 INSERT INTO buildpackagejob (id, job, build) VALUES (1, 1, 8);
20
21=== modified file 'database/sampledata/current.sql'
22--- database/sampledata/current.sql 2013-11-28 06:45:20 +0000
23+++ database/sampledata/current.sql 2013-11-28 06:45:20 +0000
24@@ -3652,6 +3652,15 @@
25 ALTER TABLE bugwatchactivity ENABLE TRIGGER ALL;
26
27
28+ALTER TABLE builderprocessor DISABLE TRIGGER ALL;
29+
30+INSERT INTO builderprocessor (builder, processor) VALUES (1, 1);
31+INSERT INTO builderprocessor (builder, processor) VALUES (2, 1);
32+
33+
34+ALTER TABLE builderprocessor ENABLE TRIGGER ALL;
35+
36+
37 ALTER TABLE buildpackagejob DISABLE TRIGGER ALL;
38
39 INSERT INTO buildpackagejob (id, job, build) VALUES (1, 1, 8);
40
41=== added file 'database/schema/patch-2209-52-0.sql'
42--- database/schema/patch-2209-52-0.sql 1970-01-01 00:00:00 +0000
43+++ database/schema/patch-2209-52-0.sql 2013-11-28 06:45:20 +0000
44@@ -0,0 +1,18 @@
45+-- Copyright 2013 Canonical Ltd. This software is licensed under the
46+-- GNU Affero General Public License version 3 (see the file LICENSE).
47+
48+SET client_min_messages=ERROR;
49+
50+ALTER TABLE builder ALTER COLUMN processor DROP NOT NULL;
51+
52+CREATE TABLE builderprocessor (
53+ builder integer NOT NULL REFERENCES builder,
54+ processor integer NOT NULL REFERENCES processor,
55+ PRIMARY KEY (builder, processor)
56+);
57+CREATE INDEX builderprocessor__processor__idx ON builderprocessor(processor);
58+
59+INSERT INTO builderprocessor (builder, processor)
60+ SELECT id, processor FROM builder;
61+
62+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 52, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: