Merge lp:~michael.nelson/launchpad/db-changes-build-generalisation-new into lp:launchpad/db-devel
- db-changes-build-generalisation-new
- Merge into db-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 9405 | ||||
Proposed branch: | lp:~michael.nelson/launchpad/db-changes-build-generalisation-new | ||||
Merge into: | lp:launchpad/db-devel | ||||
Diff against target: |
736 lines (+484/-113) 5 files modified
database/sampledata/current-dev.sql (+112/-44) database/sampledata/current.sql (+112/-44) database/schema/comments.sql (+26/-17) database/schema/patch-2207-57-0.sql (+210/-0) database/schema/security.cfg (+24/-8) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/launchpad/db-changes-build-generalisation-new | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Björn Tillenius (community) | db | Approve | |
Stuart Bishop (community) | db | Approve | |
Review via email: mp+25594@code.launchpad.net |
Commit message
Description of the change
This branch is the schema change required for:
https:/
https:/
A slightly out-of-date visual for the schema change can be seen here:
http://
Overview
========
This schema change splits the current Build table into three: BuildFarmJob, PackageBuild and BinaryPackageBuild, and then migrates the data across. It also updates foreign key references, and some old views that are still used by the codebase to use the new tables.
I did chat with stub about this and he said with only a few hundred thousand records, performance isn't an issue, but it would be good to get him to confirm that after reading through the patch (we'll also test it on dogfood).
There is a pipeline of over 7k lines of code changes that need to land with this that ensures all the tests pass. It's all approved, currently ending with:
I just need to merge those changes with a fresh db-devel and resolve conflicts, before getting this on dogfood for some serious testing.
Michael Nelson (michael.nelson) wrote : | # |
Michael Nelson (michael.nelson) wrote : | # |
Never mind... dropping the constraints on todrop.build worked.
Stuart Bishop (stub) wrote : | # |
Yes, you need to manually drop the constraints in the DB patch I'm afraid.
Stuart Bishop (stub) wrote : | # |
This looks great. Comments, naming standards, indexes - all pretty good.
+CREATE TABLE BinaryPackageBuild (
+ id serial PRIMARY KEY,
+ package_build integer NOT NULL CONSTRAINT binarypackagebu
+ distro_arch_series integer NOT NULL CONSTRAINT binarypackagebu
+ source_
I believe Sourcepackage is one word in Launchpad's vocabulary, so that last column should be sourcepackage_
+CREATE TABLE BinaryPackageBuild (
+ id serial PRIMARY KEY,
+ package_build integer NOT NULL CONSTRAINT binarypackagebu
+ distro_arch_series integer NOT NULL CONSTRAINT binarypackagebu
+ source_
+);
+
+CREATE UNIQUE INDEX binarypackagebu
+-- Indexes that we can no longer create:
+-- CREATE UNIQUE INDEX binarypackagebu
+-- CREATE INDEX binarypackagebu
+-- CREATE INDEX binarypackagebu
+CREATE INDEX binarypackagebu
We might need an index on distro_arch_series too
CREATE INDEX binarypackagebu
+-- Step 2
+-- Migrate the current data from the build table to the newly created
+-- relationships.
+CREATE OR REPLACE FUNCTION migrate_
+LANGUAGE plpgsql AS
+$$
+DECLARE
+ build_info RECORD;
+ rows_migrated integer;
+ buildfarmjob_id integer;
+ packagebuild_id integer;
+BEGIN
+ rows_migrated := 0;
+ FOR build_info IN
+ SELECT
+ build.id,
+ build.processor,
+ archive.
+ -- Currently we do not know if a build was virtual or not? (it's
+ -- only on the archive and the builder, both of which can
+ -- change). IBuild.
+ build.datecreated AS date_created,
+ (build.datebuilt - build.builddura
+ build.datebuilt AS date_finished,
+ build.date_
+ build.builder,
+ build.buildstate AS status,
+ build.buildlog AS log,
+ build.archive,
+ build.pocket,
+ build.upload_log,
+ build.dependencies,
+ build.distroarc
+ build.sourcepac
+ build.build_
+ FROM
+ build JOIN archive ON build.archive = archive.id
We have to have 'ORDER BY Build.id' at the end here. Any data migration in a DB patch is run individually on each database replica. We have to guarantee that it will run iden...
Michael Nelson (michael.nelson) wrote : | # |
On Thu, May 20, 2010 at 4:29 PM, Stuart Bishop
<email address hidden> wrote:
> Review: Approve db
> This looks great. Comments, naming standards, indexes - all pretty good.
Thanks Stuart.
>
>
> +CREATE TABLE BinaryPackageBuild (
> + id serial PRIMARY KEY,
> + package_build integer NOT NULL CONSTRAINT binarypackagebu
> + distro_arch_series integer NOT NULL CONSTRAINT binarypackagebu
> + source_
>
> I believe Sourcepackage is one word in Launchpad's vocabulary, so that last column should be sourcepackage_
The current devel code has sourcepackagere
other non-underscored vars seen in the schema change - datecreated,
buildlog, etc.), and part of this change is to start using underscores
consistently.
Grepping for "source_package" in the tip of db-devel has 1113 hits
(skip over the wadl ;) ) for variable names "source_package" in
registry, as well as things like "source_
"source_
"sourcepackage", due to the old non-underscored variable and column
names (sourcepackagename, sourcepackagere
Since no one commented on the suggestion in the diagram at:
http://
I've gone ahead and code source_
of changes. Bjorn, if you feel strongly about it, I can change the
schema and the code (or just change the schema and field definition
for the moment?), but I'd prefer to leave it for the moment, and if
you'd like the change, do a separate branch later to standardise
(we'll need to do this anyway as we've lots of other classes that
still use names without any underscores).
>
>
> +CREATE TABLE BinaryPackageBuild (
> + id serial PRIMARY KEY,
> + package_build integer NOT NULL CONSTRAINT binarypackagebu
> + distro_arch_series integer NOT NULL CONSTRAINT binarypackagebu
> + source_
> +);
> +
> +CREATE UNIQUE INDEX binarypackagebu
> +-- Indexes that we can no longer create:
> +-- CREATE UNIQUE INDEX binarypackagebu
> +-- CREATE INDEX binarypackagebu
> +-- CREATE INDEX binarypackagebu
> +CREATE INDEX binarypackagebu
>
> We might need an index on distro_arch_series too
>
> CREATE INDEX binarypackagebu
Björn Tillenius (bjornt) wrote : | # |
The schema changes look good. I'm having a hard time following the migration part, but I trust that Stuart reviewed it, and that you test it on dogfood properly.
Michael Nelson (michael.nelson) wrote : | # |
Thanks Bjorn. I've another question for you both: the patch moves the old build table to todrop.build and deletes its constraints.
Should I have a contingency patch that (1) restores the old table, (2) restores its constraints (3) moves the new tables to the todrop namespace?
I'm kindof nervous about landing this as I don't see a way to back it out if need be (given the size etc.)
I'll get this tested today on dogfood.
Stuart Bishop (stub) wrote : | # |
You could write a patch to do that now and probably waste your time, or you could write it if you actually need it. The trick will not be renaming the tables, but migrating updated data back.
Michael Nelson (michael.nelson) wrote : | # |
{{{
launchpad@
./database/
2010-05-26 11:58:50 INFO Applying patches to unreplicated environment.
2010-05-26 11:58:50 INFO Applying trusted.sql
2010-05-26 11:58:50 DEBUG Committing changes
2010-05-26 11:58:50 DEBUG Found patch 2207.57.0 -- ./database/
2010-05-26 11:58:50 INFO Applying ./database/
^[2010-05-26 13:41:57 DEBUG Committing changes
2010-05-26 13:41:57 INFO Applying comments.sql
2010-05-26 13:42:03 DEBUG Committing changes
2010-05-26 13:42:03 DEBUG Committing changes
real 103m14.459s
user 0m1.340s
sys 0m0.430s
launchpad@mawson
}}}
Stuart Bishop (stub) wrote : | # |
Dogfood isn't great for timings. Staging timings are better.
If we think it is too slow, or we can't wait to land on staging to be sure, I'll need to refactor the migration.
Michael Nelson (michael.nelson) wrote : | # |
{{{
11:01 < stub> noodles775: It took 17 minutes on staging, so maybe 35-40 mins to apply to production.
11:01 < noodles775> stub: thanks. I assume that's way too long? What is acceptable?
11:02 < stub> Thats up to the release manager and losas
11:02 < noodles775> OK.
11:10 < stub> noodles775: This version should be identical and takes 8 minutes, so 16-20 mins on production: http://
11:11 < noodles775> Thanks stub... I'll update and send it off to ec2... but at this time I don't think I'll be landing it.. there seem to be other issues with teh current db-devel on dogfood that need looking in to.
}}}
Preview Diff
1 | === modified file 'database/sampledata/current-dev.sql' |
2 | --- database/sampledata/current-dev.sql 2010-04-28 13:58:04 +0000 |
3 | +++ database/sampledata/current-dev.sql 2010-05-27 13:25:49 +0000 |
4 | @@ -785,6 +785,12 @@ |
5 | |
6 | |
7 | |
8 | + |
9 | + |
10 | + |
11 | + |
12 | + |
13 | + |
14 | SET SESSION AUTHORIZATION DEFAULT; |
15 | |
16 | ALTER TABLE account DISABLE TRIGGER ALL; |
17 | @@ -2512,21 +2518,6 @@ |
18 | ALTER TABLE authtoken ENABLE TRIGGER ALL; |
19 | |
20 | |
21 | -ALTER TABLE binarypackagename DISABLE TRIGGER ALL; |
22 | - |
23 | -INSERT INTO binarypackagename (id, name) VALUES (6, 'foobar'); |
24 | -INSERT INTO binarypackagename (id, name) VALUES (8, 'mozilla-firefox'); |
25 | -INSERT INTO binarypackagename (id, name) VALUES (13, 'pmount'); |
26 | -INSERT INTO binarypackagename (id, name) VALUES (14, 'linux-2.6.12'); |
27 | -INSERT INTO binarypackagename (id, name) VALUES (15, 'at'); |
28 | -INSERT INTO binarypackagename (id, name) VALUES (16, 'cdrkit'); |
29 | -INSERT INTO binarypackagename (id, name) VALUES (17, 'commercialpackage'); |
30 | -INSERT INTO binarypackagename (id, name) VALUES (18, 'mozilla-firefox-data'); |
31 | - |
32 | - |
33 | -ALTER TABLE binarypackagename ENABLE TRIGGER ALL; |
34 | - |
35 | - |
36 | ALTER TABLE processor DISABLE TRIGGER ALL; |
37 | |
38 | INSERT INTO processor (id, family, name, title, description) VALUES (1, 1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family'); |
39 | @@ -2546,6 +2537,68 @@ |
40 | ALTER TABLE builder ENABLE TRIGGER ALL; |
41 | |
42 | |
43 | +ALTER TABLE buildfarmjob DISABLE TRIGGER ALL; |
44 | + |
45 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (2, 1, false, '2004-09-27 11:57:13', '2004-09-27 11:55:13', '2004-09-27 11:57:14', NULL, 1, 1, 1, 1); |
46 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (6, 1, false, '2006-12-01 00:00:00', '2006-12-01 00:00:00', '2006-12-01 00:00:01', NULL, 1, 2, 1, 1); |
47 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (7, 1, false, '2005-03-24 00:00:00', '2005-03-24 23:58:43', '2005-03-25 00:00:03', NULL, 1, 1, 1, 1); |
48 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (8, 1, false, '2005-09-30 00:00:00', NULL, NULL, NULL, NULL, 6, NULL, 1); |
49 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (9, 1, false, '2005-10-01 00:00:00', '2005-10-01 23:56:41', '2005-10-02 00:00:01', NULL, 1, 2, 1, 1); |
50 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (10, 1, false, '2006-01-27 00:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
51 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (11, 1, false, '2006-02-14 00:00:00', NULL, NULL, NULL, NULL, 0, NULL, 1); |
52 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (12, 1, false, '2006-02-28 00:00:00', '2006-02-27 23:53:59', '2006-02-28 00:00:01', NULL, 1, 3, 1, 1); |
53 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (13, 1, false, '2006-03-21 00:00:00', '2006-03-21 00:58:33', '2006-03-21 01:00:03', NULL, 1, 5, 1, 1); |
54 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (14, 1, false, '2006-03-22 00:00:00', '2006-03-21 00:58:32', '2006-03-21 01:00:02', NULL, 1, 5, 1, 1); |
55 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (15, 1, false, '2006-03-22 00:00:01', '2006-03-21 00:58:30', '2006-03-21 01:00:00', NULL, 1, 5, 1, 1); |
56 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (16, 1, false, '2005-03-24 00:00:01', '2005-03-24 23:58:42', '2005-03-25 00:00:02', NULL, 1, 1, 1, 1); |
57 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (18, 1, false, '2004-09-27 11:57:14', '2004-09-27 11:55:12', '2004-09-27 11:57:13', NULL, 1, 1, 1, 1); |
58 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (19, 1, false, '2005-03-24 00:00:02', '2005-03-24 23:58:41', '2005-03-25 00:00:01', NULL, 1, 1, 1, 1); |
59 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (21, 1, false, '2006-12-01 00:00:01', NULL, NULL, NULL, NULL, 2, NULL, 1); |
60 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (22, 1, false, '2007-04-20 00:00:00', '2007-04-19 23:58:41', '2007-04-20 00:00:01', NULL, 1, 7, 1, 1); |
61 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (23, 1, false, '2006-04-11 12:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
62 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (24, 1, true, '2007-05-30 00:00:00', '2007-05-29 23:58:41', '2007-05-30 00:00:01', NULL, 1, 2, 1, 1); |
63 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (25, 1, true, '2007-07-08 12:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
64 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1); |
65 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1); |
66 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1); |
67 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', NULL, '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1); |
68 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1); |
69 | + |
70 | + |
71 | +ALTER TABLE buildfarmjob ENABLE TRIGGER ALL; |
72 | + |
73 | + |
74 | +ALTER TABLE packagebuild DISABLE TRIGGER ALL; |
75 | + |
76 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (1, 2, 1, 0, NULL, NULL); |
77 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (2, 6, 1, 0, NULL, NULL); |
78 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (3, 7, 1, 0, NULL, NULL); |
79 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (4, 8, 1, 0, NULL, NULL); |
80 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (5, 9, 1, 0, NULL, NULL); |
81 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (6, 10, 1, 0, NULL, NULL); |
82 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (7, 11, 1, 0, NULL, NULL); |
83 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (8, 12, 1, 0, NULL, 'cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2)'); |
84 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (9, 13, 1, 0, NULL, NULL); |
85 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (10, 14, 1, 0, NULL, NULL); |
86 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (11, 15, 1, 0, NULL, NULL); |
87 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (12, 16, 1, 0, NULL, NULL); |
88 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (13, 18, 1, 0, NULL, NULL); |
89 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (14, 19, 1, 0, NULL, NULL); |
90 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (15, 21, 1, 0, NULL, NULL); |
91 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (16, 22, 1, 0, 91, NULL); |
92 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (17, 23, 1, 0, NULL, NULL); |
93 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (18, 24, 11, 0, NULL, NULL); |
94 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (19, 25, 9, 0, NULL, NULL); |
95 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (20, 26, 9, 0, NULL, NULL); |
96 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (21, 27, 9, 0, NULL, NULL); |
97 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (22, 28, 9, 0, NULL, NULL); |
98 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (23, 29, 12, 0, NULL, NULL); |
99 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (24, 30, 1, 0, NULL, NULL); |
100 | + |
101 | + |
102 | +ALTER TABLE packagebuild ENABLE TRIGGER ALL; |
103 | + |
104 | + |
105 | ALTER TABLE section DISABLE TRIGGER ALL; |
106 | |
107 | INSERT INTO section (id, name) VALUES (1, 'base'); |
108 | @@ -2681,35 +2734,50 @@ |
109 | ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL; |
110 | |
111 | |
112 | -ALTER TABLE build DISABLE TRIGGER ALL; |
113 | - |
114 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (2, '2004-09-27 11:57:13', 1, 1, 1, '2004-09-27 11:57:14', '00:02:01', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
115 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (6, '2006-12-01 00:00:00', 1, 1, 2, '2006-12-01 00:00:01', '00:00:01', 1, 1, 32, 0, NULL, 1, NULL, NULL, NULL); |
116 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (7, '2005-03-24 00:00:00', 1, 6, 1, '2005-03-25 00:00:03', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
117 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (8, '2005-09-30 00:00:00', 1, 6, 6, NULL, NULL, NULL, NULL, 14, 0, NULL, 1, NULL, NULL, NULL); |
118 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (9, '2005-10-01 00:00:00', 1, 1, 2, '2005-10-02 00:00:01', '00:03:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
119 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (10, '2006-01-27 00:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 26, 0, NULL, 1, NULL, NULL, NULL); |
120 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (11, '2006-02-14 00:00:00', 1, 6, 0, NULL, NULL, NULL, NULL, 25, 0, NULL, 1, NULL, NULL, NULL); |
121 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (12, '2006-02-28 00:00:00', 1, 6, 3, '2006-02-28 00:00:01', '00:06:02', 1, 1, 27, 0, 'cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2)', 1, NULL, NULL, NULL); |
122 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (13, '2006-03-21 00:00:00', 1, 1, 5, '2006-03-21 01:00:03', '00:01:30', 1, 1, 17, 0, NULL, 1, NULL, NULL, NULL); |
123 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (14, '2006-03-22 00:00:00', 1, 1, 5, '2006-03-21 01:00:02', '00:01:30', 1, 1, 28, 0, NULL, 1, NULL, NULL, NULL); |
124 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (15, '2006-03-22 00:00:01', 1, 1, 5, '2006-03-21 01:00:00', '00:01:30', 1, 1, 29, 0, NULL, 1, NULL, NULL, NULL); |
125 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (16, '2005-03-24 00:00:01', 1, 11, 1, '2005-03-25 00:00:02', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
126 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (18, '2004-09-27 11:57:14', 1, 8, 1, '2004-09-27 11:57:13', '00:02:01', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
127 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (19, '2005-03-24 00:00:02', 1, 8, 1, '2005-03-25 00:00:01', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
128 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (21, '2006-12-01 00:00:01', 1, 1, 2, NULL, NULL, NULL, NULL, 33, 0, NULL, 1, NULL, NULL, NULL); |
129 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (22, '2007-04-20 00:00:00', 1, 8, 7, '2007-04-20 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 1, NULL, NULL, 91); |
130 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (23, '2006-04-11 12:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 35, 0, NULL, 1, NULL, NULL, NULL); |
131 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (24, '2007-05-30 00:00:00', 1, 1, 2, '2007-05-30 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 11, NULL, NULL, NULL); |
132 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (25, '2007-07-08 12:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 35, 0, NULL, 9, NULL, NULL, NULL); |
133 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (26, '2007-07-08 00:00:00', 1, 8, 2, '2007-07-08 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 9, NULL, NULL, NULL); |
134 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (27, '2007-07-24 00:00:00', 1, 1, 1, '2007-07-24 00:00:01', '00:01:20', 1, 1, 20, 0, NULL, 9, NULL, NULL, NULL); |
135 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (28, '2007-08-10 00:00:00', 3, 12, 1, '2007-08-10 00:00:13', '00:00:13', 1, 1, 14, 0, NULL, 9, NULL, NULL, NULL); |
136 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (29, '2007-08-09 21:54:18.553132', 1, 8, 1, '2007-08-09 23:59:59', NULL, NULL, NULL, 36, 0, NULL, 12, NULL, NULL, NULL); |
137 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (30, '2007-08-10 00:00:01', 3, 12, 1, '2007-08-10 00:00:14', '00:00:13', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
138 | - |
139 | - |
140 | -ALTER TABLE build ENABLE TRIGGER ALL; |
141 | +ALTER TABLE binarypackagebuild DISABLE TRIGGER ALL; |
142 | + |
143 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (2, 1, 1, 14); |
144 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (6, 2, 1, 32); |
145 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (7, 3, 6, 20); |
146 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (8, 4, 6, 14); |
147 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (9, 5, 1, 20); |
148 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (10, 6, 1, 26); |
149 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (11, 7, 6, 25); |
150 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (12, 8, 6, 27); |
151 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (13, 9, 1, 17); |
152 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (14, 10, 1, 28); |
153 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (15, 11, 1, 29); |
154 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (16, 12, 11, 20); |
155 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (18, 13, 8, 14); |
156 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (19, 14, 8, 20); |
157 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (21, 15, 1, 33); |
158 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (22, 16, 8, 33); |
159 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (23, 17, 1, 35); |
160 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (24, 18, 1, 33); |
161 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (25, 19, 1, 35); |
162 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (26, 20, 8, 33); |
163 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (27, 21, 1, 20); |
164 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (28, 22, 12, 14); |
165 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (29, 23, 8, 36); |
166 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (30, 24, 12, 14); |
167 | + |
168 | + |
169 | +ALTER TABLE binarypackagebuild ENABLE TRIGGER ALL; |
170 | + |
171 | + |
172 | +ALTER TABLE binarypackagename DISABLE TRIGGER ALL; |
173 | + |
174 | +INSERT INTO binarypackagename (id, name) VALUES (6, 'foobar'); |
175 | +INSERT INTO binarypackagename (id, name) VALUES (8, 'mozilla-firefox'); |
176 | +INSERT INTO binarypackagename (id, name) VALUES (13, 'pmount'); |
177 | +INSERT INTO binarypackagename (id, name) VALUES (14, 'linux-2.6.12'); |
178 | +INSERT INTO binarypackagename (id, name) VALUES (15, 'at'); |
179 | +INSERT INTO binarypackagename (id, name) VALUES (16, 'cdrkit'); |
180 | +INSERT INTO binarypackagename (id, name) VALUES (17, 'commercialpackage'); |
181 | +INSERT INTO binarypackagename (id, name) VALUES (18, 'mozilla-firefox-data'); |
182 | + |
183 | + |
184 | +ALTER TABLE binarypackagename ENABLE TRIGGER ALL; |
185 | |
186 | |
187 | ALTER TABLE binarypackagerelease DISABLE TRIGGER ALL; |
188 | |
189 | === modified file 'database/sampledata/current.sql' |
190 | --- database/sampledata/current.sql 2010-04-28 13:58:04 +0000 |
191 | +++ database/sampledata/current.sql 2010-05-27 13:25:49 +0000 |
192 | @@ -785,6 +785,12 @@ |
193 | |
194 | |
195 | |
196 | + |
197 | + |
198 | + |
199 | + |
200 | + |
201 | + |
202 | SET SESSION AUTHORIZATION DEFAULT; |
203 | |
204 | ALTER TABLE account DISABLE TRIGGER ALL; |
205 | @@ -2470,21 +2476,6 @@ |
206 | ALTER TABLE authtoken ENABLE TRIGGER ALL; |
207 | |
208 | |
209 | -ALTER TABLE binarypackagename DISABLE TRIGGER ALL; |
210 | - |
211 | -INSERT INTO binarypackagename (id, name) VALUES (6, 'foobar'); |
212 | -INSERT INTO binarypackagename (id, name) VALUES (8, 'mozilla-firefox'); |
213 | -INSERT INTO binarypackagename (id, name) VALUES (13, 'pmount'); |
214 | -INSERT INTO binarypackagename (id, name) VALUES (14, 'linux-2.6.12'); |
215 | -INSERT INTO binarypackagename (id, name) VALUES (15, 'at'); |
216 | -INSERT INTO binarypackagename (id, name) VALUES (16, 'cdrkit'); |
217 | -INSERT INTO binarypackagename (id, name) VALUES (17, 'commercialpackage'); |
218 | -INSERT INTO binarypackagename (id, name) VALUES (18, 'mozilla-firefox-data'); |
219 | - |
220 | - |
221 | -ALTER TABLE binarypackagename ENABLE TRIGGER ALL; |
222 | - |
223 | - |
224 | ALTER TABLE processor DISABLE TRIGGER ALL; |
225 | |
226 | INSERT INTO processor (id, family, name, title, description) VALUES (1, 1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family'); |
227 | @@ -2504,6 +2495,68 @@ |
228 | ALTER TABLE builder ENABLE TRIGGER ALL; |
229 | |
230 | |
231 | +ALTER TABLE buildfarmjob DISABLE TRIGGER ALL; |
232 | + |
233 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (2, 1, false, '2004-09-27 11:57:13', '2004-09-27 11:55:13', '2004-09-27 11:57:14', NULL, 1, 1, 1, 1); |
234 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (6, 1, false, '2006-12-01 00:00:00', '2006-12-01 00:00:00', '2006-12-01 00:00:01', NULL, 1, 2, 1, 1); |
235 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (7, 1, false, '2005-03-24 00:00:00', '2005-03-24 23:58:43', '2005-03-25 00:00:03', NULL, 1, 1, 1, 1); |
236 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (8, 1, false, '2005-09-30 00:00:00', NULL, NULL, NULL, NULL, 6, NULL, 1); |
237 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (9, 1, false, '2005-10-01 00:00:00', '2005-10-01 23:56:41', '2005-10-02 00:00:01', NULL, 1, 2, 1, 1); |
238 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (10, 1, false, '2006-01-27 00:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
239 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (11, 1, false, '2006-02-14 00:00:00', NULL, NULL, NULL, NULL, 0, NULL, 1); |
240 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (12, 1, false, '2006-02-28 00:00:00', '2006-02-27 23:53:59', '2006-02-28 00:00:01', NULL, 1, 3, 1, 1); |
241 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (13, 1, false, '2006-03-21 00:00:00', '2006-03-21 00:58:33', '2006-03-21 01:00:03', NULL, 1, 5, 1, 1); |
242 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (14, 1, false, '2006-03-22 00:00:00', '2006-03-21 00:58:32', '2006-03-21 01:00:02', NULL, 1, 5, 1, 1); |
243 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (15, 1, false, '2006-03-22 00:00:01', '2006-03-21 00:58:30', '2006-03-21 01:00:00', NULL, 1, 5, 1, 1); |
244 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (16, 1, false, '2005-03-24 00:00:01', '2005-03-24 23:58:42', '2005-03-25 00:00:02', NULL, 1, 1, 1, 1); |
245 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (18, 1, false, '2004-09-27 11:57:14', '2004-09-27 11:55:12', '2004-09-27 11:57:13', NULL, 1, 1, 1, 1); |
246 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (19, 1, false, '2005-03-24 00:00:02', '2005-03-24 23:58:41', '2005-03-25 00:00:01', NULL, 1, 1, 1, 1); |
247 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (21, 1, false, '2006-12-01 00:00:01', NULL, NULL, NULL, NULL, 2, NULL, 1); |
248 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (22, 1, false, '2007-04-20 00:00:00', '2007-04-19 23:58:41', '2007-04-20 00:00:01', NULL, 1, 7, 1, 1); |
249 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (23, 1, false, '2006-04-11 12:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
250 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (24, 1, true, '2007-05-30 00:00:00', '2007-05-29 23:58:41', '2007-05-30 00:00:01', NULL, 1, 2, 1, 1); |
251 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (25, 1, true, '2007-07-08 12:00:00', NULL, NULL, NULL, NULL, 1, NULL, 1); |
252 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1); |
253 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1); |
254 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1); |
255 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', NULL, '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1); |
256 | +INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1); |
257 | + |
258 | + |
259 | +ALTER TABLE buildfarmjob ENABLE TRIGGER ALL; |
260 | + |
261 | + |
262 | +ALTER TABLE packagebuild DISABLE TRIGGER ALL; |
263 | + |
264 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (1, 2, 1, 0, NULL, NULL); |
265 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (2, 6, 1, 0, NULL, NULL); |
266 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (3, 7, 1, 0, NULL, NULL); |
267 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (4, 8, 1, 0, NULL, NULL); |
268 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (5, 9, 1, 0, NULL, NULL); |
269 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (6, 10, 1, 0, NULL, NULL); |
270 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (7, 11, 1, 0, NULL, NULL); |
271 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (8, 12, 1, 0, NULL, 'cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2)'); |
272 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (9, 13, 1, 0, NULL, NULL); |
273 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (10, 14, 1, 0, NULL, NULL); |
274 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (11, 15, 1, 0, NULL, NULL); |
275 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (12, 16, 1, 0, NULL, NULL); |
276 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (13, 18, 1, 0, NULL, NULL); |
277 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (14, 19, 1, 0, NULL, NULL); |
278 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (15, 21, 1, 0, NULL, NULL); |
279 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (16, 22, 1, 0, 91, NULL); |
280 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (17, 23, 1, 0, NULL, NULL); |
281 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (18, 24, 11, 0, NULL, NULL); |
282 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (19, 25, 9, 0, NULL, NULL); |
283 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (20, 26, 9, 0, NULL, NULL); |
284 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (21, 27, 9, 0, NULL, NULL); |
285 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (22, 28, 9, 0, NULL, NULL); |
286 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (23, 29, 12, 0, NULL, NULL); |
287 | +INSERT INTO packagebuild (id, build_farm_job, archive, pocket, upload_log, dependencies) VALUES (24, 30, 1, 0, NULL, NULL); |
288 | + |
289 | + |
290 | +ALTER TABLE packagebuild ENABLE TRIGGER ALL; |
291 | + |
292 | + |
293 | ALTER TABLE section DISABLE TRIGGER ALL; |
294 | |
295 | INSERT INTO section (id, name) VALUES (1, 'base'); |
296 | @@ -2639,35 +2692,50 @@ |
297 | ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL; |
298 | |
299 | |
300 | -ALTER TABLE build DISABLE TRIGGER ALL; |
301 | - |
302 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (2, '2004-09-27 11:57:13', 1, 1, 1, '2004-09-27 11:57:14', '00:02:01', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
303 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (6, '2006-12-01 00:00:00', 1, 1, 2, '2006-12-01 00:00:01', '00:00:01', 1, 1, 32, 0, NULL, 1, NULL, NULL, NULL); |
304 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (7, '2005-03-24 00:00:00', 1, 6, 1, '2005-03-25 00:00:03', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
305 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (8, '2005-09-30 00:00:00', 1, 6, 6, NULL, NULL, NULL, NULL, 14, 0, NULL, 1, NULL, NULL, NULL); |
306 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (9, '2005-10-01 00:00:00', 1, 1, 2, '2005-10-02 00:00:01', '00:03:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
307 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (10, '2006-01-27 00:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 26, 0, NULL, 1, NULL, NULL, NULL); |
308 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (11, '2006-02-14 00:00:00', 1, 6, 0, NULL, NULL, NULL, NULL, 25, 0, NULL, 1, NULL, NULL, NULL); |
309 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (12, '2006-02-28 00:00:00', 1, 6, 3, '2006-02-28 00:00:01', '00:06:02', 1, 1, 27, 0, 'cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2)', 1, NULL, NULL, NULL); |
310 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (13, '2006-03-21 00:00:00', 1, 1, 5, '2006-03-21 01:00:03', '00:01:30', 1, 1, 17, 0, NULL, 1, NULL, NULL, NULL); |
311 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (14, '2006-03-22 00:00:00', 1, 1, 5, '2006-03-21 01:00:02', '00:01:30', 1, 1, 28, 0, NULL, 1, NULL, NULL, NULL); |
312 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (15, '2006-03-22 00:00:01', 1, 1, 5, '2006-03-21 01:00:00', '00:01:30', 1, 1, 29, 0, NULL, 1, NULL, NULL, NULL); |
313 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (16, '2005-03-24 00:00:01', 1, 11, 1, '2005-03-25 00:00:02', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
314 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (18, '2004-09-27 11:57:14', 1, 8, 1, '2004-09-27 11:57:13', '00:02:01', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
315 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (19, '2005-03-24 00:00:02', 1, 8, 1, '2005-03-25 00:00:01', '00:01:20', 1, 1, 20, 0, NULL, 1, NULL, NULL, NULL); |
316 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (21, '2006-12-01 00:00:01', 1, 1, 2, NULL, NULL, NULL, NULL, 33, 0, NULL, 1, NULL, NULL, NULL); |
317 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (22, '2007-04-20 00:00:00', 1, 8, 7, '2007-04-20 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 1, NULL, NULL, 91); |
318 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (23, '2006-04-11 12:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 35, 0, NULL, 1, NULL, NULL, NULL); |
319 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (24, '2007-05-30 00:00:00', 1, 1, 2, '2007-05-30 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 11, NULL, NULL, NULL); |
320 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (25, '2007-07-08 12:00:00', 1, 1, 1, NULL, NULL, NULL, NULL, 35, 0, NULL, 9, NULL, NULL, NULL); |
321 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (26, '2007-07-08 00:00:00', 1, 8, 2, '2007-07-08 00:00:01', '00:01:20', 1, 1, 33, 0, NULL, 9, NULL, NULL, NULL); |
322 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (27, '2007-07-24 00:00:00', 1, 1, 1, '2007-07-24 00:00:01', '00:01:20', 1, 1, 20, 0, NULL, 9, NULL, NULL, NULL); |
323 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (28, '2007-08-10 00:00:00', 3, 12, 1, '2007-08-10 00:00:13', '00:00:13', 1, 1, 14, 0, NULL, 9, NULL, NULL, NULL); |
324 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (29, '2007-08-09 21:54:18.553132', 1, 8, 1, '2007-08-09 23:59:59', NULL, NULL, NULL, 36, 0, NULL, 12, NULL, NULL, NULL); |
325 | -INSERT INTO build (id, datecreated, processor, distroarchseries, buildstate, datebuilt, buildduration, buildlog, builder, sourcepackagerelease, pocket, dependencies, archive, build_warnings, date_first_dispatched, upload_log) VALUES (30, '2007-08-10 00:00:01', 3, 12, 1, '2007-08-10 00:00:14', '00:00:13', 1, 1, 14, 0, NULL, 1, NULL, NULL, NULL); |
326 | - |
327 | - |
328 | -ALTER TABLE build ENABLE TRIGGER ALL; |
329 | +ALTER TABLE binarypackagebuild DISABLE TRIGGER ALL; |
330 | + |
331 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (2, 1, 1, 14); |
332 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (6, 2, 1, 32); |
333 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (7, 3, 6, 20); |
334 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (8, 4, 6, 14); |
335 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (9, 5, 1, 20); |
336 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (10, 6, 1, 26); |
337 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (11, 7, 6, 25); |
338 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (12, 8, 6, 27); |
339 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (13, 9, 1, 17); |
340 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (14, 10, 1, 28); |
341 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (15, 11, 1, 29); |
342 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (16, 12, 11, 20); |
343 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (18, 13, 8, 14); |
344 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (19, 14, 8, 20); |
345 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (21, 15, 1, 33); |
346 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (22, 16, 8, 33); |
347 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (23, 17, 1, 35); |
348 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (24, 18, 1, 33); |
349 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (25, 19, 1, 35); |
350 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (26, 20, 8, 33); |
351 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (27, 21, 1, 20); |
352 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (28, 22, 12, 14); |
353 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (29, 23, 8, 36); |
354 | +INSERT INTO binarypackagebuild (id, package_build, distro_arch_series, source_package_release) VALUES (30, 24, 12, 14); |
355 | + |
356 | + |
357 | +ALTER TABLE binarypackagebuild ENABLE TRIGGER ALL; |
358 | + |
359 | + |
360 | +ALTER TABLE binarypackagename DISABLE TRIGGER ALL; |
361 | + |
362 | +INSERT INTO binarypackagename (id, name) VALUES (6, 'foobar'); |
363 | +INSERT INTO binarypackagename (id, name) VALUES (8, 'mozilla-firefox'); |
364 | +INSERT INTO binarypackagename (id, name) VALUES (13, 'pmount'); |
365 | +INSERT INTO binarypackagename (id, name) VALUES (14, 'linux-2.6.12'); |
366 | +INSERT INTO binarypackagename (id, name) VALUES (15, 'at'); |
367 | +INSERT INTO binarypackagename (id, name) VALUES (16, 'cdrkit'); |
368 | +INSERT INTO binarypackagename (id, name) VALUES (17, 'commercialpackage'); |
369 | +INSERT INTO binarypackagename (id, name) VALUES (18, 'mozilla-firefox-data'); |
370 | + |
371 | + |
372 | +ALTER TABLE binarypackagename ENABLE TRIGGER ALL; |
373 | |
374 | |
375 | ALTER TABLE binarypackagerelease DISABLE TRIGGER ALL; |
376 | |
377 | === modified file 'database/schema/comments.sql' |
378 | --- database/schema/comments.sql 2010-05-20 13:59:11 +0000 |
379 | +++ database/schema/comments.sql 2010-05-27 13:25:49 +0000 |
380 | @@ -1596,23 +1596,32 @@ |
381 | COMMENT ON COLUMN PushMirrorAccess.name IS 'Name of an arch archive on the push mirror, e.g. lord@emf.net--2003-example'; |
382 | COMMENT ON COLUMN PushMirrorAccess.person IS 'A person that has access to update the named archive'; |
383 | |
384 | --- Build |
385 | -COMMENT ON TABLE Build IS 'Build: This table stores the build procedure information of a sourcepackagerelease and its results (binarypackagereleases) for a given distroarchseries.'; |
386 | -COMMENT ON COLUMN Build.datecreated IS 'When the build record was created.'; |
387 | -COMMENT ON COLUMN Build.datebuilt IS 'When the build record was processed.'; |
388 | -COMMENT ON COLUMN Build.buildduration IS 'How long this build took to be processed.'; |
389 | -COMMENT ON COLUMN Build.distroarchseries IS 'Points the target Distroarchrelease for this build.'; |
390 | -COMMENT ON COLUMN Build.processor IS 'Points to the Distroarchrelease available processor target for this build.'; |
391 | -COMMENT ON COLUMN Build.sourcepackagerelease IS 'Sourcepackagerelease which originated this build.'; |
392 | -COMMENT ON COLUMN Build.buildstate IS 'Stores the current build procedure state.'; |
393 | -COMMENT ON COLUMN Build.buildlog IS 'Points to the buildlog file stored in librarian.'; |
394 | -COMMENT ON COLUMN Build.builder IS 'Points to the builder which has once processed it.'; |
395 | -COMMENT ON COLUMN Build.pocket IS 'Stores the target pocket identifier for this build.'; |
396 | -COMMENT ON COLUMN Build.dependencies IS 'Contains a debian-like dependency line specifying the current missing-dependencies for this package.'; |
397 | -COMMENT ON COLUMN Build.archive IS 'Targeted archive for this build.'; |
398 | -COMMENT ON COLUMN Build.build_warnings IS 'Warnings and diagnosis messages provided by the builder while building this job.'; |
399 | -COMMENT ON COLUMN Build.date_first_dispatched IS 'The instant the build was dispatched the first time. This value will not get overridden if the build is retried.'; |
400 | -COMMENT ON COLUMN Build.upload_log IS 'Reference to a LibraryFileAlias containing the upload log messages generated while processing the binaries resulted from this build.'; |
401 | +-- BuildFarmJob, and its related tables, PackageBuild, BinaryPackageBuild |
402 | +COMMENT ON TABLE BuildFarmJob IS 'BuildFarmJob: This table stores the information common to all jobs on the Launchpad build farm.'; |
403 | +COMMENT ON COLUMN BuildFarmJob.processor IS 'Points to the required processor target for this job, or null.'; |
404 | +COMMENT ON COLUMN BuildFarmJob.virtualized IS 'The virtualization setting required by this build farm job, or null.'; |
405 | +COMMENT ON COLUMN BuildFarmJob.date_created IS 'When the build farm job record was created.'; |
406 | +COMMENT ON COLUMN BuildFarmJob.date_started IS 'When the build farm job started being processed.'; |
407 | +COMMENT ON COLUMN BuildFarmJob.date_finished IS 'When the build farm job finished being processed.'; |
408 | +COMMENT ON COLUMN BuildFarmJob.date_first_dispatched IS 'The instant the build was dispatched the first time. This value will not get overridden if the build is retried.'; |
409 | +COMMENT ON COLUMN BuildFarmJob.builder IS 'Points to the builder which processed this build farm job.'; |
410 | +COMMENT ON COLUMN BuildFarmJob.status IS 'Stores the current build status.'; |
411 | +COMMENT ON COLUMN BuildFarmJob.log IS 'Points to the log for this build farm job file stored in librarian.'; |
412 | +COMMENT ON COLUMN BuildFarmJob.job_type IS 'The type of build farm job to which this record corresponds.'; |
413 | + |
414 | +-- PackageBuild |
415 | +COMMENT ON TABLE PackageBuild IS 'PackageBuild: This table stores the information common to build farm jobs that build source or binary packages.'; |
416 | +COMMENT ON COLUMN PackageBuild.build_farm_job IS 'Points to the build farm job with the base information.'; |
417 | +COMMENT ON COLUMN PackageBuild.archive IS 'Targeted archive for this package build.'; |
418 | +COMMENT ON COLUMN PackageBuild.pocket IS 'Stores the target pocket identifier for this package build.'; |
419 | +COMMENT ON COLUMN PackageBuild.upload_log IS 'Reference to a LibraryFileAlias containing the upload log messages generated while processing the packages resulting from this package build.'; |
420 | +COMMENT ON COLUMN PackageBuild.dependencies IS 'Contains a debian-like dependency line specifying the current missing-dependencies for this package.'; |
421 | + |
422 | +-- BinaryPackageBuild |
423 | +COMMENT ON TABLE BinaryPackageBuild IS 'BinaryPackageBuild: This table links a package build with a distroarchseries and sourcepackagerelease.'; |
424 | +COMMENT ON COLUMN BinaryPackageBuild.package_build IS 'Points to the related package build with the base information.'; |
425 | +COMMENT ON COLUMN BinaryPackageBuild.distro_arch_series IS 'Points the target DistroArchSeries for this build.'; |
426 | +COMMENT ON COLUMN BinaryPackageBuild.source_package_release IS 'SourcePackageRelease which originated this build.'; |
427 | |
428 | -- Builder |
429 | COMMENT ON TABLE Builder IS 'Builder: This table stores the build-slave registry and status information as: name, url, trusted, builderok, builderaction, failnotes.'; |
430 | |
431 | === added file 'database/schema/patch-2207-57-0.sql' |
432 | --- database/schema/patch-2207-57-0.sql 1970-01-01 00:00:00 +0000 |
433 | +++ database/schema/patch-2207-57-0.sql 2010-05-27 13:25:49 +0000 |
434 | @@ -0,0 +1,210 @@ |
435 | +-- Copyright 2010 Canonical Ltd. This software is licensed under the |
436 | +-- GNU Affero General Public License version 3 (see the file LICENSE). |
437 | + |
438 | +SET client_min_messages=ERROR; |
439 | + |
440 | +CREATE TEMPORARY TABLE BuildInfo AS |
441 | +SELECT |
442 | + build.id, |
443 | + build.processor, |
444 | + archive.require_virtualized AS virtualized, |
445 | + -- Currently we do not know if a build was virtual or not? (it's |
446 | + -- only on the archive and the builder, both of which can |
447 | + -- change). IBuild.is_virtualized just queries the archive. |
448 | + build.datecreated AS date_created, |
449 | + (build.datebuilt - build.buildduration) AS date_started, |
450 | + build.datebuilt AS date_finished, |
451 | + build.date_first_dispatched, |
452 | + build.builder, |
453 | + build.buildstate AS status, |
454 | + build.buildlog AS log, |
455 | + build.archive, |
456 | + build.pocket, |
457 | + build.upload_log, |
458 | + build.dependencies, |
459 | + build.distroarchseries AS distro_arch_series, |
460 | + build.sourcepackagerelease AS source_package_release, |
461 | + build.build_warnings -- We don't seem to use this in LP code at all? |
462 | +FROM build JOIN archive ON build.archive = archive.id; |
463 | + |
464 | +-- The schema patch for general build histories. See |
465 | +-- https://dev.launchpad.net/LEP/GeneralBuildHistories and the linked |
466 | +-- blueprint/bug for more information. |
467 | + |
468 | +-- Step 1 |
469 | +-- Create the new BuildFarmJob, PackageBuild and BinaryPackageBuild tables, |
470 | +-- with indexes based on the current Build table. |
471 | +CREATE TABLE BuildFarmJob ( |
472 | + id serial PRIMARY KEY, |
473 | + processor integer |
474 | + CONSTRAINT buildfarmjob__processor__fk REFERENCES processor, |
475 | + virtualized boolean, |
476 | + date_created timestamp without time zone |
477 | + DEFAULT timezone('UTC'::text, now()) NOT NULL, |
478 | + date_started timestamp without time zone, |
479 | + date_finished timestamp without time zone, |
480 | + date_first_dispatched timestamp without time zone, |
481 | + builder integer CONSTRAINT buildfarmjob__builder__fk REFERENCES builder, |
482 | + status integer NOT NULL, |
483 | + log integer CONSTRAINT buildfarmjob__log__fk REFERENCES libraryfilealias, |
484 | + job_type integer NOT NULL |
485 | +); |
486 | + |
487 | +INSERT INTO BuildFarmJob ( |
488 | + id, processor, virtualized, date_created, date_started, |
489 | + date_finished, builder, status, log, job_type) |
490 | +SELECT |
491 | + id, processor, virtualized, date_created, date_started, |
492 | + date_finished, builder, status, log, 1 |
493 | +FROM BuildInfo; |
494 | + |
495 | +SELECT setval('buildfarmjob_id_seq', MAX(id)) FROM BuildFarmJob; |
496 | + |
497 | +CREATE INDEX buildfarmjob__date_created__idx ON buildfarmjob(date_created); |
498 | +CREATE INDEX buildfarmjob__date_started__idx ON buildfarmjob(date_started); |
499 | +CREATE INDEX buildfarmjob__date_finished__idx ON buildfarmjob(date_finished); |
500 | +CREATE INDEX buildfarmjob__builder_and_status__idx |
501 | + ON buildfarmjob(builder, status); |
502 | +CREATE INDEX buildfarmjob__log__idx ON buildfarmjob(log) WHERE log IS NOT NULL; |
503 | + |
504 | + |
505 | +CREATE TABLE PackageBuild ( |
506 | + id serial PRIMARY KEY, |
507 | + build_farm_job integer NOT NULL |
508 | + CONSTRAINT packagebuild__build_farm_job__fk REFERENCES buildfarmjob, |
509 | + archive integer NOT NULL |
510 | + CONSTRAINT packagebuild__archive__fk REFERENCES archive, |
511 | + pocket integer NOT NULL DEFAULT 0, |
512 | + upload_log integer |
513 | + CONSTRAINT packagebuild__log__fk REFERENCES libraryfilealias, |
514 | + dependencies text |
515 | +); |
516 | + |
517 | +INSERT INTO PackageBuild ( |
518 | + id, build_farm_job, archive, pocket, upload_log, dependencies) |
519 | +SELECT id, id AS build_farm_job, archive, pocket, upload_log, dependencies |
520 | +FROM BuildInfo; |
521 | +SELECT setval('packagebuild_id_seq', MAX(id)) FROM PackageBuild; |
522 | + |
523 | +CREATE UNIQUE INDEX packagebuild__build_farm_job__idx ON packagebuild( |
524 | + build_farm_job); |
525 | +CREATE INDEX packagebuild__archive__idx ON packagebuild(archive); |
526 | +CREATE INDEX packagebuild__upload_log__idx ON packagebuild(upload_log) |
527 | + WHERE upload_log IS NOT NULL; |
528 | + |
529 | +CREATE TABLE BinaryPackageBuild ( |
530 | + id serial PRIMARY KEY, |
531 | + package_build integer NOT NULL |
532 | + CONSTRAINT binarypackagebuild__package_build__fk |
533 | + REFERENCES packagebuild, |
534 | + distro_arch_series integer NOT NULL |
535 | + CONSTRAINT binarypackagebuild__distro_arch_series__fk |
536 | + REFERENCES distroarchseries, |
537 | + source_package_release integer NOT NULL |
538 | + CONSTRAINT binarypackagebuild__source_package_release__fk |
539 | + REFERENCES sourcepackagerelease |
540 | +); |
541 | + |
542 | +INSERT INTO binarypackagebuild( |
543 | + id, package_build, distro_arch_series, source_package_release) |
544 | +SELECT id, id, distro_arch_series, source_package_release |
545 | +FROM BuildInfo; |
546 | + |
547 | +SELECT setval('binarypackagebuild_id_seq', MAX(id)) FROM BinaryPackageBuild; |
548 | + |
549 | +CREATE UNIQUE INDEX binarypackagebuild__package_build__idx |
550 | + ON binarypackagebuild(package_build); |
551 | +-- Indexes that we can no longer create: |
552 | +-- CREATE UNIQUE INDEX binarypackagebuild__distro_arch_series_uniq__idx ON binarypackagebuild(distro_arch_series, source_package_release, archive) |
553 | +-- CREATE INDEX binarypackagebuild__distro_arch_series__status__idx ON binarypackagebuild(distro_arch_series, status?) |
554 | +-- CREATE INDEX binarypackagebuild__distro_arch_series__date_finished ON binarypackagebuild(distro_arch_series, date_finished) |
555 | +CREATE INDEX binarypackagebuild__source_package_release_idx |
556 | + ON binarypackagebuild(source_package_release); |
557 | +CREATE INDEX binarypackagebuild__distro_arch_series__idx |
558 | + ON BinaryPackageBuild(distro_arch_series); |
559 | + |
560 | +-- Step 3 |
561 | +-- Need to update all the references to the current build table to point to |
562 | +-- the new table, shown by: |
563 | +-- launchpad_dev=# select t.constraint_name, t.table_name, t.constraint_type, |
564 | +-- launchpad_dev-# c.table_name, c.column_name |
565 | +-- launchpad_dev-# from information_schema.table_constraints t, |
566 | +-- launchpad_dev-# information_schema.constraint_column_usage c |
567 | +-- launchpad_dev-# where t.constraint_name = c.constraint_name |
568 | +-- launchpad_dev-# and t.constraint_type = 'FOREIGN KEY' |
569 | +-- launchpad_dev-# and c.table_name = 'build' |
570 | +-- launchpad_dev-# ; |
571 | + |
572 | +-- "binarypackagerelease__build__fk" FOREIGN KEY (build) REFERENCES build(id) ON DELETE CASCADE |
573 | +ALTER TABLE BinaryPackageRelease DROP CONSTRAINT binarypackagerelease__build__fk; |
574 | +ALTER TABLE BinaryPackageRelease |
575 | + ADD CONSTRAINT binarypackagerelease_build_fk |
576 | + FOREIGN KEY (build) REFERENCES binarypackagebuild(id) ON DELETE CASCADE; |
577 | + |
578 | +-- "buildpackagejob__build__fk" FOREIGN KEY (build) REFERENCES build(id) |
579 | +ALTER TABLE BuildPackageJob DROP CONSTRAINT buildpackagejob__build__fk; |
580 | +ALTER TABLE BuildPackageJob |
581 | + ADD CONSTRAINT buildpackagejob_build_fk |
582 | + FOREIGN KEY (build) REFERENCES binarypackagebuild(id); |
583 | + |
584 | +-- "packageuploadbuild_build_fk" FOREIGN KEY (build) REFERENCES build(id) |
585 | +ALTER TABLE packageuploadbuild DROP CONSTRAINT packageuploadbuild_build_fk; |
586 | +ALTER TABLE packageuploadbuild |
587 | + ADD CONSTRAINT packageuploadbuild_build_fk |
588 | + FOREIGN KEY (build) REFERENCES binarypackagebuild(id); |
589 | + |
590 | + |
591 | +-- "securebinarypackagepublishinghistory_supersededby_fk" FOREIGN KEY (supersededby) REFERENCES build(id) |
592 | +ALTER TABLE binarypackagepublishinghistory |
593 | + DROP CONSTRAINT securebinarypackagepublishinghistory_supersededby_fk; |
594 | +ALTER TABLE binarypackagepublishinghistory |
595 | + ADD CONSTRAINT binarypackagepublishinghistory_supersededby_fk |
596 | + FOREIGN KEY (supersededby) REFERENCES binarypackagebuild(id); |
597 | + |
598 | + |
599 | +-- Step 4 |
600 | +-- Drop the old Build table and its constraints. |
601 | +ALTER TABLE Build SET SCHEMA todrop; |
602 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__archive__fk; |
603 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__builder__fk; |
604 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__buildlog__fk; |
605 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__distroarchseries__fk; |
606 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__processor__fk; |
607 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__sourcepackagerelease__fk; |
608 | +ALTER TABLE todrop.Build DROP CONSTRAINT build__upload_log__fk; |
609 | + |
610 | + |
611 | +-- Step 5 |
612 | +-- Update views that reference the build table: |
613 | +CREATE OR REPLACE VIEW PublishedPackage AS |
614 | +SELECT securebinarypackagepublishinghistory.id, distroarchseries.id AS distroarchseries, distroseries.distribution, distroseries.id AS distroseries, distroseries.name AS distroseriesname, processorfamily.id AS processorfamily, processorfamily.name AS processorfamilyname, securebinarypackagepublishinghistory.status AS packagepublishingstatus, component.name AS component, section.name AS section, binarypackagerelease.id AS binarypackagerelease, binarypackagename.name AS binarypackagename, binarypackagerelease.summary AS binarypackagesummary, binarypackagerelease.description AS binarypackagedescription, binarypackagerelease.version AS binarypackageversion, binarypackagebuild.id AS build, buildfarmjob.date_finished AS datebuilt, sourcepackagerelease.id AS sourcepackagerelease, sourcepackagerelease.version AS sourcepackagereleaseversion, sourcepackagename.name AS sourcepackagename, securebinarypackagepublishinghistory.pocket, securebinarypackagepublishinghistory.archive, binarypackagerelease.fti AS binarypackagefti |
615 | + FROM binarypackagepublishinghistory securebinarypackagepublishinghistory |
616 | + JOIN distroarchseries ON distroarchseries.id = securebinarypackagepublishinghistory.distroarchseries |
617 | + JOIN distroseries ON distroarchseries.distroseries = distroseries.id |
618 | + JOIN processorfamily ON distroarchseries.processorfamily = processorfamily.id |
619 | + JOIN component ON securebinarypackagepublishinghistory.component = component.id |
620 | + JOIN binarypackagerelease ON securebinarypackagepublishinghistory.binarypackagerelease = binarypackagerelease.id |
621 | + JOIN section ON securebinarypackagepublishinghistory.section = section.id |
622 | + JOIN binarypackagename ON binarypackagerelease.binarypackagename = binarypackagename.id |
623 | + JOIN binarypackagebuild ON binarypackagerelease.build = binarypackagebuild.id |
624 | + JOIN packagebuild ON binarypackagebuild.package_build = packagebuild.id |
625 | + JOIN buildfarmjob ON packagebuild.build_farm_job = buildfarmjob.id |
626 | + JOIN sourcepackagerelease ON binarypackagebuild.source_package_release = sourcepackagerelease.id |
627 | + JOIN sourcepackagename ON sourcepackagerelease.sourcepackagename = sourcepackagename.id |
628 | + WHERE securebinarypackagepublishinghistory.dateremoved IS NULL; |
629 | + |
630 | +CREATE OR REPLACE VIEW BinaryPackageFilePublishing As |
631 | +SELECT (libraryfilealias.id::text || '.'::text) || securebinarypackagepublishinghistory.id::text AS id, distroseries.distribution, securebinarypackagepublishinghistory.id AS binarypackagepublishing, component.name AS componentname, libraryfilealias.filename AS libraryfilealiasfilename, sourcepackagename.name AS sourcepackagename, binarypackagefile.libraryfile AS libraryfilealias, distroseries.name AS distroseriesname, distroarchseries.architecturetag, securebinarypackagepublishinghistory.status AS publishingstatus, securebinarypackagepublishinghistory.pocket, securebinarypackagepublishinghistory.archive |
632 | + FROM binarypackagepublishinghistory securebinarypackagepublishinghistory |
633 | + JOIN binarypackagerelease ON securebinarypackagepublishinghistory.binarypackagerelease = binarypackagerelease.id |
634 | + JOIN binarypackagebuild ON binarypackagerelease.build = binarypackagebuild.id |
635 | + JOIN sourcepackagerelease ON binarypackagebuild.source_package_release = sourcepackagerelease.id |
636 | + JOIN sourcepackagename ON sourcepackagerelease.sourcepackagename = sourcepackagename.id |
637 | + JOIN binarypackagefile ON binarypackagefile.binarypackagerelease = binarypackagerelease.id |
638 | + JOIN libraryfilealias ON binarypackagefile.libraryfile = libraryfilealias.id |
639 | + JOIN distroarchseries ON securebinarypackagepublishinghistory.distroarchseries = distroarchseries.id |
640 | + JOIN distroseries ON distroarchseries.distroseries = distroseries.id |
641 | + JOIN component ON securebinarypackagepublishinghistory.component = component.id |
642 | + WHERE securebinarypackagepublishinghistory.dateremoved IS NULL; |
643 | + |
644 | +INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 57, 0); |
645 | |
646 | === modified file 'database/schema/security.cfg' |
647 | --- database/schema/security.cfg 2010-05-20 13:59:11 +0000 |
648 | +++ database/schema/security.cfg 2010-05-27 13:25:49 +0000 |
649 | @@ -293,7 +293,9 @@ |
650 | public.bug = SELECT |
651 | public.bugaffectsperson = SELECT, INSERT, UPDATE, DELETE |
652 | public.bugtask = SELECT |
653 | -public.build = SELECT |
654 | +public.buildfarmjob = SELECT |
655 | +public.packagebuild = SELECT |
656 | +public.binarypackagebuild = SELECT |
657 | public.distribution = SELECT |
658 | public.distributionsourcepackagecache = SELECT, INSERT, UPDATE, DELETE |
659 | public.distroarchseries = SELECT, UPDATE |
660 | @@ -344,7 +346,9 @@ |
661 | public.binarypackagefile = SELECT |
662 | public.branchmergeproposal = SELECT |
663 | public.bugattachment = SELECT |
664 | -public.build = SELECT |
665 | +public.buildfarmjob = SELECT |
666 | +public.packagebuild = SELECT |
667 | +public.binarypackagebuild = SELECT |
668 | public.codeimportresult = SELECT |
669 | public.diff = SELECT |
670 | public.distribution = SELECT |
671 | @@ -633,7 +637,9 @@ |
672 | public.binarypackagefile = SELECT |
673 | public.binarypackagename = SELECT |
674 | public.binarypackagerelease = SELECT |
675 | -public.build = SELECT |
676 | +public.buildfarmjob = SELECT |
677 | +public.packagebuild = SELECT |
678 | +public.binarypackagebuild = SELECT |
679 | public.component = SELECT |
680 | public.componentselection = SELECT |
681 | public.distribution = SELECT |
682 | @@ -787,7 +793,9 @@ |
683 | public.job = SELECT, INSERT, UPDATE, DELETE |
684 | public.buildpackagejob = SELECT, INSERT, UPDATE, DELETE |
685 | public.builder = SELECT, INSERT, UPDATE |
686 | -public.build = SELECT, INSERT, UPDATE |
687 | +public.buildfarmjob = SELECT, INSERT, UPDATE |
688 | +public.packagebuild = SELECT, INSERT, UPDATE |
689 | +public.binarypackagebuild = SELECT, INSERT, UPDATE |
690 | public.distribution = SELECT, UPDATE |
691 | public.distroseries = SELECT, UPDATE |
692 | public.distroarchseries = SELECT, UPDATE |
693 | @@ -871,7 +879,9 @@ |
694 | public.bugtracker = SELECT, INSERT, UPDATE, DELETE |
695 | public.bugtrackeralias = SELECT, INSERT, UPDATE, DELETE |
696 | public.bugwatch = SELECT, INSERT, UPDATE, DELETE |
697 | -public.build = SELECT, INSERT, UPDATE |
698 | +public.buildfarmjob = SELECT, INSERT, UPDATE |
699 | +public.packagebuild = SELECT, INSERT, UPDATE |
700 | +public.binarypackagebuild = SELECT, INSERT, UPDATE |
701 | public.builder = SELECT, INSERT, UPDATE |
702 | public.buildqueue = SELECT, INSERT, UPDATE, DELETE |
703 | public.job = SELECT, INSERT, UPDATE, DELETE |
704 | @@ -1061,7 +1071,9 @@ |
705 | public.sourcepackagereleasefile = SELECT, INSERT |
706 | public.binarypackagefile = SELECT, INSERT |
707 | public.pocketchroot = SELECT |
708 | -public.build = SELECT, INSERT, UPDATE |
709 | +public.buildfarmjob = SELECT, INSERT, UPDATE |
710 | +public.packagebuild = SELECT, INSERT, UPDATE |
711 | +public.binarypackagebuild = SELECT, INSERT, UPDATE |
712 | public.sourcepackagerecipebuild = SELECT, UPDATE |
713 | public.buildqueue = SELECT, INSERT, UPDATE |
714 | public.job = SELECT, INSERT, UPDATE |
715 | @@ -1146,7 +1158,9 @@ |
716 | public.processor = SELECT |
717 | public.processorfamily = SELECT |
718 | public.distrocomponentuploader = SELECT |
719 | -public.build = SELECT, INSERT, UPDATE |
720 | +public.buildfarmjob = SELECT, INSERT, UPDATE |
721 | +public.packagebuild = SELECT, INSERT, UPDATE |
722 | +public.binarypackagebuild = SELECT, INSERT, UPDATE |
723 | public.buildqueue = SELECT, INSERT, UPDATE |
724 | public.job = SELECT, INSERT, UPDATE |
725 | public.buildpackagejob = SELECT, INSERT, UPDATE |
726 | @@ -1809,7 +1823,9 @@ |
727 | [nagios] |
728 | type=user |
729 | public.archive = SELECT |
730 | -public.build = SELECT |
731 | +public.buildfarmjob = SELECT |
732 | +public.packagebuild = SELECT |
733 | +public.binarypackagebuild = SELECT |
734 | public.buildqueue = SELECT |
735 | public.buildpackagejob = SELECT |
736 | public.job = SELECT |
Hi stub or BjornT:
When I ran this schema change (together with the code changes) through ec2 test, I see the following error in test_sampledata - it seems related to moving the old build table to the todrop namespace rather than deleting it leaves the constraints in place - I assume I just remove the constraints on todrop.build?
http:// pastebin. ubuntu. com/436693/
Also, there are a bunch of other failures:
http:// pastebin. ubuntu. com/436699/
which are (I assume) because listReferences( cursor( ), 'libraryfilealias', 'id') still returns 'build' as a from table? pastebin. ubuntu. com/436710/
http://