Remove unused Jobs columns

Actually, we can *almost* get rid of the Jobs table entirely...
This commit is contained in:
Eelco Dolstra 2013-05-23 12:11:46 -04:00
parent b1f89bf92d
commit 7b5e92868b
4 changed files with 3 additions and 34 deletions

View file

@ -876,15 +876,10 @@ sub checkBuild {
my $build;
txn_do($db, sub {
# Update the last evaluation time in the database.
my $job = $jobset->jobs->update_or_create(
{ name => $jobName
, lastevaltime => time
});
$job->update({firstevaltime => time})
unless defined $job->firstevaltime;
# Don't add a build that has already been scheduled for this
# job, or has been built but is still a "current" build for
# this job. Note that this means that if the sources of a job

View file

@ -40,27 +40,11 @@ __PACKAGE__->table("Jobs");
data_type: 'text'
is_nullable: 0
=head2 active
data_type: 'integer'
default_value: 1
is_nullable: 0
=head2 errormsg
data_type: 'text'
is_nullable: 1
=head2 firstevaltime
data_type: 'integer'
is_nullable: 1
=head2 lastevaltime
data_type: 'integer'
is_nullable: 1
=cut
__PACKAGE__->add_columns(
@ -70,14 +54,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
"name",
{ data_type => "text", is_nullable => 0 },
"active",
{ data_type => "integer", default_value => 1, is_nullable => 0 },
"errormsg",
{ data_type => "text", is_nullable => 1 },
"firstevaltime",
{ data_type => "integer", is_nullable => 1 },
"lastevaltime",
{ data_type => "integer", is_nullable => 1 },
);
=head1 PRIMARY KEY
@ -148,7 +126,7 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-05-03 14:35:11
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uZ27Dcbywi99pCW7Ml4j3A
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-05-23 16:09:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JgxEaCz/TW9YKa+HavRzXw
1;

View file

@ -100,13 +100,8 @@ create table Jobs (
jobset text not null,
name text not null,
active integer not null default 1, -- !!! obsolete, remove
errorMsg text, -- evalution error for this job
firstEvalTime integer, -- first time the evaluator saw this job
lastEvalTime integer, -- last time the evaluator saw this job
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

1
src/sql/upgrade-16.sql Normal file
View file

@ -0,0 +1 @@
alter table Jobs drop column active, drop column firstEvalTime, drop column lastEvalTime;