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

@ -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;