Drop unused "disabled" columns

This commit is contained in:
Eelco Dolstra 2013-05-03 16:39:17 +02:00
parent 906b129f6a
commit 507e5bb190
6 changed files with 9 additions and 69 deletions

View file

@ -70,48 +70,6 @@
- Start hydra_evaluator and hydra_queue_runner
* Upgrade notes:
alter table builds add column longDescription text;
alter table builds add column license text;
alter table projects add column homepage text;
alter table builds add column homepage text;
alter table BuildProducts add column defaultPath text;
alter table BuildResultInfo add column failedDepBuild integer;
alter table BuildResultInfo add column failedDepStepNr integer;
alter table ReleaseSetJobs add column jobset text not null default "trunk";
=== (DB dump/load needed after Sqlite upgrade) ===
insert into jobs(project, jobset, name, active) select distinct project, jobset, job, 0 from builds b where not exists (select 1 from jobs where project = b.project and jobset = b.jobset and name = b.job);
create index IndexBuildInputsByBuild on BuildInputs(build);
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;
# Add the isCurrent column to Builds and use the obsolete Jobs.active to fill it in.
alter table builds add column isCurrent integer default 0;
update builds set isCurrent = 1 where id in (select max(id) from builds natural join (select distinct b.project, b.jobset, b.job, b.system from builds b join (select project, jobset, name from jobs where active = 1) j on b.project = j.project and b.jobset = j.jobset and b.job = j.name) b2 group by project, jobset, job, system);
alter table Jobsets add column enabled integer not null default 1;
# Releases -> Views.
alter table ReleaseSets rename to Views;
alter table ReleaseSetJobs rename to ViewJobs;
alter table ViewJobs rename column release_ to view_;
alter table ViewJobs drop column mayFail;
alter table ViewJobs add column autorelease integer not null default 0;
alter table Builds add column nixExprInput text;
alter table Builds add column nixExprPath text;
# Adding JobsetEvals.
drop table JobsetInputHashes;
(add JobsetEvals, JobsetEvalMembers)
* Job selection:
php-sat:build [system = "i686-linux"]

View file

@ -147,12 +147,6 @@ __PACKAGE__->table("Builds");
data_type: 'text'
is_nullable: 1
=head2 disabled
data_type: 'integer'
default_value: 0
is_nullable: 0
=head2 starttime
data_type: 'integer'
@ -248,8 +242,6 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"logfile",
{ data_type => "text", is_nullable => 1 },
"disabled",
{ data_type => "integer", default_value => 0, is_nullable => 0 },
"starttime",
{ data_type => "integer", is_nullable => 1 },
"stoptime",
@ -465,8 +457,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-30 16:22:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YBdqPWScG4dtGx+U3dJcwA
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-05-03 14:35:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aYVEk+AeDsgTRi5GAqOhEw
__PACKAGE__->has_many(
"dependents",

View file

@ -61,12 +61,6 @@ __PACKAGE__->table("Jobs");
data_type: 'integer'
is_nullable: 1
=head2 disabled
data_type: 'integer'
default_value: 0
is_nullable: 0
=cut
__PACKAGE__->add_columns(
@ -84,8 +78,6 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 1 },
"lastevaltime",
{ data_type => "integer", is_nullable => 1 },
"disabled",
{ data_type => "integer", default_value => 0, is_nullable => 0 },
);
=head1 PRIMARY KEY
@ -156,7 +148,7 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vfl4QtuyeKeEk9+Ap7FP2A
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-05-03 14:35:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uZ27Dcbywi99pCW7Ml4j3A
1;

View file

@ -55,7 +55,7 @@ sub findBuildDependencyInQueue {
my @deps = grep { /\.drv$/ && $_ ne $build->drvpath } computeFSClosure(0, 0, $build->drvpath);
return unless scalar @deps > 0;
return $db->resultset('Builds')->search(
{ drvpath => [ @deps ], finished => 0, enabled => 1, disabled => 0 },
{ drvpath => [ @deps ], finished => 0, enabled => 1 },
{ join => ['project'], rows => 1 })->single;
}
@ -79,7 +79,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 },
{ finished => 0, busy => 0, enabled => 1 },
{ join => ['project'], select => ['system'], as => ['system'], distinct => 1 });
# For each system type, select up to the maximum number of
@ -99,7 +99,7 @@ sub checkBuilds {
# Select the highest-priority builds to start.
my @builds = $extraAllowed == 0 ? () : $db->resultset('Builds')->search(
{ finished => 0, busy => 0, system => $system->system, enabled => 1, disabled => 0 },
{ finished => 0, busy => 0, system => $system->system, enabled => 1 },
{ join => ['project'], order_by => ["priority DESC", "timestamp"],
rows => $extraAllowed });

View file

@ -107,8 +107,6 @@ create table Jobs (
firstEvalTime integer, -- first time the evaluator saw this job
lastEvalTime integer, -- last time the evaluator saw this job
disabled integer not null default 0, -- !!! not currently used
primary key (project, jobset, name),
foreign key (project) references Projects(name) on delete cascade on update cascade,
foreign key (project, jobset) references Jobsets(project, name) on delete cascade on update cascade
@ -160,8 +158,6 @@ create table Builds (
logfile text, -- if busy, the path of the logfile
disabled integer not null default 0, -- !!! boolean
startTime integer, -- if busy, time we started
stopTime integer,

2
src/sql/upgrade-14.sql Normal file
View file

@ -0,0 +1,2 @@
alter table Jobs drop column disabled;
alter table Builds drop column disabled;