diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index e387bf8c..9e3014d0 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -26,7 +26,7 @@ sub overview : Chained('job') PathPart('') Args(0) { getBuildStats($c, scalar $c->stash->{job}->builds); - $c->stash->{systems} = [$c->stash->{job}->builds->search({}, {select => ["system"], distinct => 1})]; + $c->stash->{systems} = [$c->stash->{job}->builds->search({iscurrent => 1}, {select => ["system"], distinct => 1})]; } diff --git a/src/lib/Hydra/Schema.pm b/src/lib/Hydra/Schema.pm index e211f419..39973598 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.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tt53dmgGYiV3yqHvnrSwkg +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uBemU8brohK9UDFJ9KC1iA # 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 f7060f2a..34f48d14 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -103,8 +103,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:02BDWXRn4LMcb0LFjHXqjg +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3l2Qu/wpPEb/xsXoyeRviQ use Hydra::Helper::Nix; diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index f6fe69d5..a0079cf9 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -91,8 +91,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/AUVD2QjjkeQmFkKEim0Gw # 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 40d66c17..12b47e28 100644 --- a/src/lib/Hydra/Schema/BuildResultInfo.pm +++ b/src/lib/Hydra/Schema/BuildResultInfo.pm @@ -86,8 +86,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjrreyjxFwFTGDzdA9J42w +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L/qLimgzcHeLjsKom3t1XQ __PACKAGE__->belongs_to( "failedDep", diff --git a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm index 455d4421..1ed5125b 100644 --- a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm +++ b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm @@ -43,8 +43,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jgOkt31QNifyPD8Y0rkVBA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I2cNoG9FOWDlICSy4Ndftw # 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 2f60a80e..3cd3e6d1 100644 --- a/src/lib/Hydra/Schema/BuildSteps.pm +++ b/src/lib/Hydra/Schema/BuildSteps.pm @@ -91,7 +91,7 @@ __PACKAGE__->set_primary_key("build", "stepnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oCn8y9Nsffa6WOnm44lyqQ 1; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 8879edde..b1835208 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -116,6 +116,8 @@ __PACKAGE__->add_columns( is_nullable => 1, size => undef, }, + "iscurrent", + { data_type => "integer", default_value => 0, is_nullable => 1, size => undef }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); @@ -161,8 +163,8 @@ __PACKAGE__->has_many( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8r7Yv4O8WF2YU4sOjn0Q8w use Hydra::Helper::Nix; @@ -217,7 +219,7 @@ sub makeQueries { " where x.project = c.project and x.jobset = c.jobset and x.job = c.job and x.system = c.system and " . " x.id > c.id and r.buildstatus != r2.buildstatus)"; # Urgh, can't use "*" in the "select" here because of the status change join. - makeSource('JobStatus' . $name, "select x.id, x.finished, x.timestamp, x.project, x.jobset, x.job, x.nixname, x.description, x.drvpath, x.outpath, x.system, x.longdescription, x.license, x.homepage, x.maintainers, b.id as statusChangeId, b.timestamp as statusChangeTime from (select project, jobset, job, system, max(id) as id from Builds where finished = 1 $constraint group by project, jobset, job, system) as latest natural join Builds x $joinWithStatusChange"); + makeSource('JobStatus' . $name, "select x.id, x.finished, x.timestamp, x.project, x.jobset, x.job, x.nixname, x.description, x.drvpath, x.outpath, x.system, x.longdescription, x.license, x.homepage, x.maintainers, x.isCurrent, b.id as statusChangeId, b.timestamp as statusChangeTime from (select project, jobset, job, system, max(id) as id from Builds where finished = 1 $constraint group by project, jobset, job, system) as latest natural join Builds x $joinWithStatusChange"); makeSource('LatestSucceeded' . $name, "select * from (select project, jobset, job, system, max(id) as id from Builds natural join BuildResultInfo where finished = 1 and buildStatus = 0 $constraint group by project, jobset, job, system) as latest natural join Builds x"); } diff --git a/src/lib/Hydra/Schema/CachedPathInputs.pm b/src/lib/Hydra/Schema/CachedPathInputs.pm index caff7dbc..f941d7ac 100644 --- a/src/lib/Hydra/Schema/CachedPathInputs.pm +++ b/src/lib/Hydra/Schema/CachedPathInputs.pm @@ -47,8 +47,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("srcpath", "sha256hash"); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sEZCtuR96OmFAZe4ykVTUA +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eLemrXw7iydgI6zhFrghRg # 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 8c56aec8..c92b6153 100644 --- a/src/lib/Hydra/Schema/CachedSubversionInputs.pm +++ b/src/lib/Hydra/Schema/CachedSubversionInputs.pm @@ -40,8 +40,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("uri", "revision"); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ImarwuHMkKrQ2GemxREDig +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f2Xn8X5aO9Gud7LHrc/b2g # 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 7e017848..687d8eda 100644 --- a/src/lib/Hydra/Schema/Jobs.pm +++ b/src/lib/Hydra/Schema/Jobs.pm @@ -75,8 +75,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OFEAwA4W5q0AF8uZ3JswFQ +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w5CXchrT0/ueNgxnKv6TPg # 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 5af62dad..760a82ec 100644 --- a/src/lib/Hydra/Schema/JobsetInputAlts.pm +++ b/src/lib/Hydra/Schema/JobsetInputAlts.pm @@ -69,8 +69,8 @@ __PACKAGE__->belongs_to( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CQg509K7bBReX30DeMC7ww # 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 5b2a9703..2ba76da6 100644 --- a/src/lib/Hydra/Schema/JobsetInputs.pm +++ b/src/lib/Hydra/Schema/JobsetInputs.pm @@ -65,8 +65,8 @@ __PACKAGE__->has_many( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FzkQQT8t8OET0a0teF3lHA # 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 d8114245..bb924e75 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -101,8 +101,8 @@ __PACKAGE__->has_many( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eu0jlMKE2aMvQRv4LynlIA # 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 800804ef..76b95acd 100644 --- a/src/lib/Hydra/Schema/Projects.pm +++ b/src/lib/Hydra/Schema/Projects.pm @@ -76,8 +76,8 @@ __PACKAGE__->has_many( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aBN2ry0QEPIhQu6tlgk7RQ # 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 08e65d7c..5b035bee 100644 --- a/src/lib/Hydra/Schema/ReleaseSetJobs.pm +++ b/src/lib/Hydra/Schema/ReleaseSetJobs.pm @@ -66,8 +66,8 @@ __PACKAGE__->belongs_to( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Mm9VR//LwfM88N54dtmuxg # 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 746f701b..676d7e48 100644 --- a/src/lib/Hydra/Schema/ReleaseSets.pm +++ b/src/lib/Hydra/Schema/ReleaseSets.pm @@ -45,8 +45,8 @@ __PACKAGE__->has_many( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c6FKyR68F1a8wLivK9ztog # 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 d9d0d4d3..710262d1 100644 --- a/src/lib/Hydra/Schema/SystemTypes.pm +++ b/src/lib/Hydra/Schema/SystemTypes.pm @@ -21,8 +21,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("system"); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QYzvQmgXtV3NURhO5j5F4Q +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SYnu+3J84FXFqkSu8jxkPg # 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 c1d21dc5..8b0843e4 100644 --- a/src/lib/Hydra/Schema/UserRoles.pm +++ b/src/lib/Hydra/Schema/UserRoles.pm @@ -28,8 +28,8 @@ __PACKAGE__->set_primary_key("username", "role"); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); -# 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 +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pRBijh3yc0x4knK6tU4iTw # 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 67f690cf..263fc3ab 100644 --- a/src/lib/Hydra/Schema/Users.pm +++ b/src/lib/Hydra/Schema/Users.pm @@ -50,8 +50,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-07-07 14:36:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZH7GmAkTPdZm7G5aCp746A +# Created by DBIx::Class::Schema::Loader v0.04999_06 @ 2009-10-02 15:59:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d4m+IH9KxIcgId+XF23txg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/script/hydra_scheduler.pl b/src/script/hydra_scheduler.pl index 79aba43a..b099fa0f 100755 --- a/src/script/hydra_scheduler.pl +++ b/src/script/hydra_scheduler.pl @@ -252,7 +252,7 @@ sub fetchInputs { sub checkJob { - my ($project, $jobset, $inputInfo, $nixExprInput, $job) = @_; + my ($project, $jobset, $inputInfo, $nixExprInput, $job, $currentBuilds) = @_; my $jobName = $job->{jobName}; my $drvPath = $job->{drvPath}; @@ -273,15 +273,36 @@ sub checkJob { $jobInDB->update({firstevaltime => time}) unless defined $jobInDB->firstevaltime; - # Have we already done this build (in this job)? - if (scalar($jobInDB->builds->search({outPath => $outPath})) > 0) { - print "already scheduled/done\n"; - return; + # Have we already done this build (in this job)? Don't do it + # again unless it has been garbage-collected. The latest + # builds for each platforms are GC roots, so they shouldn't be + # GCed. However, if a job has reverted to a previous state, + # it's possible that a GCed build becomes current again. In + # that case we have to rebuild it to ensure that it appears in + # channels etc. + my @previousBuilds = $jobInDB->builds->search({outPath => $outPath}, {order_by => "id"}); + if (scalar(@previousBuilds) > 0) { + foreach my $build (@previousBuilds) { + if (!$build->finished) { + print "already scheduled as build ", $build->id, "\n"; + $currentBuilds->{$build->id} = 1; + return; + } + } + if (isValidPath($outPath)) { + print "already done as build ", $previousBuilds[0]->id, "\n"; + # Mark the previous build as "current" so that it will + # appear in the "latest" channel for this + # project/jobset/job. + $previousBuilds[0]->update({iscurrent => 1}); + $currentBuilds->{$previousBuilds[0]->id} = 1; + return; + } + print "already done as build ", $previousBuilds[0]->id, + "; rebuilding because it was garbage-collected\n"; } # Nope, so add it. - print "adding to queue\n"; - my $build = $jobInDB->builds->create( { finished => 0 , timestamp => time() @@ -294,8 +315,13 @@ sub checkJob { , drvpath => $drvPath , outpath => $outPath , system => $job->{system} + , iscurrent => 1 }); + print "added to queue as build ", $build->id, "\n"; + + $currentBuilds->{$build->id} = 1; + $build->create_related('buildschedulinginfo', { priority => $priority , busy => 0 @@ -403,20 +429,22 @@ sub checkJobset { or die "cannot parse XML output"; # Schedule each successfully evaluated job. + my %currentBuilds; foreach my $job (permute @{$jobs->{job}}) { next if $job->{jobName} eq ""; print "considering job " . $job->{jobName} . "\n"; - checkJob($project, $jobset, $inputInfo, $nixExprInput, $job); + checkJob($project, $jobset, $inputInfo, $nixExprInput, $job, \%currentBuilds); } - # Mark all existing jobs that we haven't seen as inactive. - my %jobNames; - $jobNames{$_->{jobName}}++ foreach @{$jobs->{job}}; - - my %failedJobNames; - push @{$failedJobNames{$_->{location}}}, $_->{msg} foreach @{$jobs->{error}}; - txn_do($db, sub { + + # Mark all existing jobs that we haven't seen as inactive. + my %jobNames; + $jobNames{$_->{jobName}}++ foreach @{$jobs->{job}}; + + my %failedJobNames; + push @{$failedJobNames{$_->{location}}}, $_->{msg} foreach @{$jobs->{error}}; + $jobset->update({lastcheckedtime => time}); foreach my $jobInDB ($jobset->jobs->all) { @@ -428,8 +456,16 @@ sub checkJobset { $jobInDB->update({errormsg => undef}); } } - }); + + # Clear the "current" flag on all builds that are no longer + # current. + foreach my $build ($jobset->builds->search({iscurrent => 1})) { + print "current is ", $build->id, "\n"; + $build->update({iscurrent => 0}) unless $currentBuilds{$build->id}; + } + }); + # Store the errors messages for jobs that failed to evaluate. my $msg = ""; foreach my $error (@{$jobs->{error}}) { diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index f3f385e8..285dac8c 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -26,6 +26,8 @@ create table Builds ( license text, -- meta.license homepage text, -- meta.homepage maintainers text, -- meta.maintainers (concatenated, comma-separated) + + isCurrent integer default 0, foreign key (project) references Projects(name), -- ignored by sqlite foreign key (project, jobset) references Jobsets(project, name), -- ignored by sqlite @@ -409,6 +411,5 @@ create index IndexBuildInputsByDependency on BuildInputs(dependency); create index IndexBuildsByTimestamp on Builds(timestamp); create index IndexBuildsByJobAndSystem on Builds(project, jobset, job, system); create index IndexBuildResultInfo on BuildResultInfo(id); -- primary key index, not created automatically by PostgreSQL - -create index indexbuild on buildproducts(build) -create index indexbuildtype on buildproducts(build, type) +create index IndexBuild on BuildProducts(build); +create index IndexBuildType on BuildProducts(build, type);