diff --git a/doc/dev-notes.txt b/doc/dev-notes.txt index bbca9fd4..8b914f00 100644 --- a/doc/dev-notes.txt +++ b/doc/dev-notes.txt @@ -86,6 +86,9 @@ create index IndexBuildInputsByDependency on BuildInputs(dependency); create index IndexBuildsByTimestamp on Builds(timestamp); + + alter table jobs add column disabled integer not null default 0; + alter table builds add column maintainers text; * Job selection: @@ -102,6 +105,13 @@ $ for i in $(cat ids); do echo $i; sqlite3 hydra.sqlite "begin transaction; insert into buildschedulinginfo (id, priority, busy, locker) values($i, 100, 0, ''); delete from buildresultinfo where id = $i; update builds set finished = 0 where id = $i; commit transaction;"; done + Or with Postgres: + + (restarting all aborted builds with ID > 42000) + $ psql -h buildfarm.st.ewi.tudelft.nl -U hydra hydra -t -c 'select x.id from builds x join buildresultinfo r on r.id = x.id where finished = 1 and buildstatus = 3 and x.id > 42000' > ids + + $ for i in $(cat ids); do echo $i; PGPASSWORD=... psql -h buildfarm.st.ewi.tudelft.nl -U hydra hydra -t -c "begin transaction; insert into buildschedulinginfo (id, priority, busy, locker) values($i, 100, 0, ''); delete from buildresultinfo where id = $i; update builds set finished = 0 where id = $i; commit transaction;"; done + * select * from (select project, jobset, job, system, max(timestamp) timestamp from builds where finished = 1 group by project, jobset, job, system) x join builds y on x.timestamp = y.timestamp and x.project = y.project and x.jobset = y.jobset and x.job = y.job and x.system = y.system; diff --git a/src/lib/Hydra/Schema.pm b/src/lib/Hydra/Schema.pm index cbbd2203..e211f419 100644 --- a/src/lib/Hydra/Schema.pm +++ b/src/lib/Hydra/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aJVSTLLx1pgutjETaqTWXA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tt53dmgGYiV3yqHvnrSwkg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index b77c83c8..f7060f2a 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -9,38 +9,105 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("BuildInputs"); __PACKAGE__->add_columns( "id", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "build", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 1, + size => undef, + }, "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "type", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "uri", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "revision", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "tag", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "value", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "dependency", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 1, + size => undef, + }, "path", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "sha256hash", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("id"); -__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); +__PACKAGE__->belongs_to( + "build", + "Hydra::Schema::Builds", + { id => "build" }, + { join_type => "LEFT OUTER" }, +); +__PACKAGE__->belongs_to( + "dependency", + "Hydra::Schema::Builds", + { id => "dependency" }, + { join_type => "LEFT OUTER" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:02BDWXRn4LMcb0LFjHXqjg use Hydra::Helper::Nix; - -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uxfS8+GnU06sbx6nvWzTSQ - sub addSequence { my $hydradbi = getHydraDBPath ; if ($hydradbi =~ m/^dbi:Pg/) { diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index b99eff40..f6fe69d5 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -9,34 +9,90 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("BuildProducts"); __PACKAGE__->add_columns( "build", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "productnr", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "type", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "subtype", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "filesize", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "sha1hash", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "sha256hash", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "path", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "defaultpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wnnwDGQMGr2YAu++PYRSuA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fqzw8pcHMrUjdJZ/a43D3w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildResultInfo.pm b/src/lib/Hydra/Schema/BuildResultInfo.pm index 66a31547..40d66c17 100644 --- a/src/lib/Hydra/Schema/BuildResultInfo.pm +++ b/src/lib/Hydra/Schema/BuildResultInfo.pm @@ -9,34 +9,85 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("BuildResultInfo"); __PACKAGE__->add_columns( "id", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "iscachedbuild", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "buildstatus", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "errormsg", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "starttime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "stoptime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "logfile", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "releasename", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "keep", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "faileddepbuild", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "faileddepstepnr", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CGlUjhJozOA4VCYaFtyhqw +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjrreyjxFwFTGDzdA9J42w __PACKAGE__->belongs_to( "failedDep", diff --git a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm index 3bb47241..455d4421 100644 --- a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm +++ b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm @@ -9,26 +9,42 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("BuildSchedulingInfo"); __PACKAGE__->add_columns( "id", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "priority", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "busy", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "locker", - { data_type => "text", is_nullable => 0, size => undef }, + { data_type => "text", default_value => "''", is_nullable => 0, size => undef }, "logfile", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "disabled", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "starttime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X+Pz2XzTBNU3XdEcg49RyQ +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jgOkt31QNifyPD8Y0rkVBA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildSteps.pm b/src/lib/Hydra/Schema/BuildSteps.pm index 8d46bc88..2f60a80e 100644 --- a/src/lib/Hydra/Schema/BuildSteps.pm +++ b/src/lib/Hydra/Schema/BuildSteps.pm @@ -9,33 +9,89 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("BuildSteps"); __PACKAGE__->add_columns( "build", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "stepnr", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "type", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "drvpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "outpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "logfile", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "busy", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "status", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "errormsg", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "starttime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "stoptime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("build", "stepnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TtcOwOIZHO0vLSJ1CXF1bA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7z14GDq6a8ndBoj3Mx/3TQ 1; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 68905b66..c78e649b 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -9,33 +9,113 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("Builds"); __PACKAGE__->add_columns( "id", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "finished", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "timestamp", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "jobset", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "job", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "nixname", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "drvpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "outpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "system", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "longdescription", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "license", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "homepage", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, + "maintainers", + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); @@ -49,13 +129,13 @@ __PACKAGE__->belongs_to( "Hydra::Schema::Jobs", { jobset => "jobset", name => "job", project => "project" }, ); -__PACKAGE__->has_many( - "buildschedulinginfoes", +__PACKAGE__->might_have( + "buildschedulinginfo", "Hydra::Schema::BuildSchedulingInfo", { "foreign.id" => "self.id" }, ); -__PACKAGE__->has_many( - "buildresultinfoes", +__PACKAGE__->might_have( + "buildresultinfo", "Hydra::Schema::BuildResultInfo", { "foreign.id" => "self.id" }, ); @@ -81,16 +161,24 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xqKyjCWVdoTyQJC28K3WXA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mTc++yn7RST163jLNJkXaw use Hydra::Helper::Nix; -__PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency'); +__PACKAGE__->has_many( + "dependents", + "Hydra::Schema::BuildInputs", + { "foreign.dependency" => "self.id" }, +); __PACKAGE__->many_to_many(dependentBuilds => 'dependents', 'build'); -__PACKAGE__->has_many(inputs => 'Hydra::Schema::BuildInputs', 'build'); +__PACKAGE__->has_many( + "inputs", + "Hydra::Schema::BuildInputs", + { "foreign.build" => "self.id" }, +); __PACKAGE__->belongs_to( "schedulingInfo", diff --git a/src/lib/Hydra/Schema/CachedPathInputs.pm b/src/lib/Hydra/Schema/CachedPathInputs.pm index 5fd4c66b..caff7dbc 100644 --- a/src/lib/Hydra/Schema/CachedPathInputs.pm +++ b/src/lib/Hydra/Schema/CachedPathInputs.pm @@ -9,21 +9,46 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("CachedPathInputs"); __PACKAGE__->add_columns( "srcpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "timestamp", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "lastseen", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "sha256hash", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "storepath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("srcpath", "sha256hash"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Eo9F2GRzgzTGGx15JWBv6Q +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sEZCtuR96OmFAZe4ykVTUA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/CachedSubversionInputs.pm b/src/lib/Hydra/Schema/CachedSubversionInputs.pm index 8cf91008..8c56aec8 100644 --- a/src/lib/Hydra/Schema/CachedSubversionInputs.pm +++ b/src/lib/Hydra/Schema/CachedSubversionInputs.pm @@ -9,19 +9,39 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("CachedSubversionInputs"); __PACKAGE__->add_columns( "uri", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "revision", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "sha256hash", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "storepath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("uri", "revision"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KeKwcnnPNoVO4eNr9+y+1g +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ImarwuHMkKrQ2GemxREDig # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Jobs.pm b/src/lib/Hydra/Schema/Jobs.pm index 928be57c..7e017848 100644 --- a/src/lib/Hydra/Schema/Jobs.pm +++ b/src/lib/Hydra/Schema/Jobs.pm @@ -9,19 +9,53 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("Jobs"); __PACKAGE__->add_columns( "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "jobset", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "active", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 1, is_nullable => 0, size => undef }, "errormsg", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "firstevaltime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "lastevaltime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, + "disabled", + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("project", "jobset", "name"); __PACKAGE__->has_many( @@ -41,8 +75,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wJFyUvUACQHpaW/ktaYtOQ +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OFEAwA4W5q0AF8uZ3JswFQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputAlts.pm b/src/lib/Hydra/Schema/JobsetInputAlts.pm index 8b3c489f..5af62dad 100644 --- a/src/lib/Hydra/Schema/JobsetInputAlts.pm +++ b/src/lib/Hydra/Schema/JobsetInputAlts.pm @@ -9,19 +9,57 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("JobsetInputAlts"); __PACKAGE__->add_columns( "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "jobset", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "input", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "altnr", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 0, + size => undef, + }, "value", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "revision", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "tag", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("project", "jobset", "input", "altnr"); __PACKAGE__->belongs_to( @@ -31,8 +69,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V8h/34X4hs4PKhxKsFgy9w +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kcIcgSux+SzIH7FQs2cnAw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputs.pm b/src/lib/Hydra/Schema/JobsetInputs.pm index 15d3f568..5b2a9703 100644 --- a/src/lib/Hydra/Schema/JobsetInputs.pm +++ b/src/lib/Hydra/Schema/JobsetInputs.pm @@ -9,13 +9,35 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("JobsetInputs"); __PACKAGE__->add_columns( "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "jobset", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "type", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("project", "jobset", "name"); __PACKAGE__->has_many( @@ -43,8 +65,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1XdnQh4HnXU/iOyNvv8QWg +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SkF1SaumgGAQvR9mUbPV+Q # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index 9148a4a5..d8114245 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -9,21 +9,64 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("Jobsets"); __PACKAGE__->add_columns( "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "nixexprinput", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "nixexprpath", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "errormsg", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "errortime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, "lastcheckedtime", - { data_type => "integer", is_nullable => 0, size => undef }, + { + data_type => "integer", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("project", "name"); __PACKAGE__->has_many( @@ -58,8 +101,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oZ81xw7qIjVkQKjRdOFW9A +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lMdNiE6x4qZLK14+jEM7YQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Projects.pm b/src/lib/Hydra/Schema/Projects.pm index 6c33f2ee..800804ef 100644 --- a/src/lib/Hydra/Schema/Projects.pm +++ b/src/lib/Hydra/Schema/Projects.pm @@ -9,17 +9,43 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("Projects"); __PACKAGE__->add_columns( "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "displayname", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "enabled", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 1, is_nullable => 0, size => undef }, "owner", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "homepage", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, ); __PACKAGE__->set_primary_key("name"); __PACKAGE__->has_many( @@ -50,8 +76,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z+RXYaHk0RXJfFirBe175A +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lDNoBncP2KhnrfbQIg+Usw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSetJobs.pm b/src/lib/Hydra/Schema/ReleaseSetJobs.pm index c8952f52..08e65d7c 100644 --- a/src/lib/Hydra/Schema/ReleaseSetJobs.pm +++ b/src/lib/Hydra/Schema/ReleaseSetJobs.pm @@ -9,21 +9,53 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("ReleaseSetJobs"); __PACKAGE__->add_columns( "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "release_", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "job", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "attrs", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "isprimary", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "mayfail", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "jobset", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("project", "release_", "job", "attrs"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); @@ -34,8 +66,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iWBkyucz/pXtzI+s0iP0EA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xaWTZqtzPyMq/xqi0ZFCDg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSets.pm b/src/lib/Hydra/Schema/ReleaseSets.pm index 2e521e67..746f701b 100644 --- a/src/lib/Hydra/Schema/ReleaseSets.pm +++ b/src/lib/Hydra/Schema/ReleaseSets.pm @@ -9,13 +9,29 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("ReleaseSets"); __PACKAGE__->add_columns( "project", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "name", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "description", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "keep", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 0, is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("project", "name"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); @@ -29,8 +45,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eeWkr8kYyCvFVDZ3YzpI1Q +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sYojSdWhlGMAL7Vj/UynBw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/SystemTypes.pm b/src/lib/Hydra/Schema/SystemTypes.pm index 5b29d4b2..d9d0d4d3 100644 --- a/src/lib/Hydra/Schema/SystemTypes.pm +++ b/src/lib/Hydra/Schema/SystemTypes.pm @@ -9,15 +9,20 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("SystemTypes"); __PACKAGE__->add_columns( "system", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "maxconcurrent", - { data_type => "integer", is_nullable => 0, size => undef }, + { data_type => "integer", default_value => 2, is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("system"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z83sYSKRnt5mc2etYvH6Zg +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QYzvQmgXtV3NURhO5j5F4Q # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/UserRoles.pm b/src/lib/Hydra/Schema/UserRoles.pm index 3aaba9ff..c1d21dc5 100644 --- a/src/lib/Hydra/Schema/UserRoles.pm +++ b/src/lib/Hydra/Schema/UserRoles.pm @@ -9,16 +9,27 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("UserRoles"); __PACKAGE__->add_columns( "username", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_foreign_key => 1, + is_nullable => 0, + size => undef, + }, "role", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("username", "role"); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WRiW+nBfh/X+TMqYu0PI6g +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:syo00cqS/fp5mJt2jg+YJw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Users.pm b/src/lib/Hydra/Schema/Users.pm index a2dc1458..67f690cf 100644 --- a/src/lib/Hydra/Schema/Users.pm +++ b/src/lib/Hydra/Schema/Users.pm @@ -9,13 +9,33 @@ __PACKAGE__->load_components("Core"); __PACKAGE__->table("Users"); __PACKAGE__->add_columns( "username", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "fullname", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 1, + size => undef, + }, "emailaddress", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, "password", - { data_type => "text", is_nullable => 0, size => undef }, + { + data_type => "text", + default_value => undef, + is_nullable => 0, + size => undef, + }, ); __PACKAGE__->set_primary_key("username"); __PACKAGE__->has_many( @@ -30,8 +50,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Gw6X/Et2+whq/S7o63zF8Q +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZH7GmAkTPdZm7G5aCp746A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/script/hydra_queue_runner.pl b/src/script/hydra_queue_runner.pl index bf204b28..05d9c3ac 100755 --- a/src/script/hydra_queue_runner.pl +++ b/src/script/hydra_queue_runner.pl @@ -61,7 +61,7 @@ sub checkBuilds { # Get the system types for the runnable builds. my @systemTypes = $db->resultset('Builds')->search( { finished => 0, busy => 0, enabled => 1, disabled => 0 }, - { join => ['schedulingInfo', 'project'], select => [{distinct => 'system'}], as => ['system'] }); + { join => ['schedulingInfo', 'project'], group_by => 'system', as => ['system'] }); # For each system type, select up to the maximum number of # concurrent build for that system type. Choose the highest diff --git a/src/script/hydra_scheduler.pl b/src/script/hydra_scheduler.pl index 5b798c73..166f435f 100755 --- a/src/script/hydra_scheduler.pl +++ b/src/script/hydra_scheduler.pl @@ -295,7 +295,7 @@ sub checkJob { , system => $job->{system} }); - $build->buildschedulinginfoes->create( + $build->create_related('buildschedulinginfo', { priority => $priority , busy => 0 , locker => "" diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 1562e17c..57a6ac70 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -25,6 +25,7 @@ create table Builds ( longDescription text, -- meta.longDescription license text, -- meta.license homepage text, -- meta.homepage + maintainers text, -- meta.maintainers (concatenated, comma-separated) foreign key (project) references Projects(name), -- ignored by sqlite foreign key (project, jobset) references Jobsets(project, name), -- ignored by sqlite