forked from lix-project/hydra
Schema: add errorMsg, errorTime to JobsetEvals
This commit is contained in:
parent
6bb876cb35
commit
d9989b7fa1
|
@ -54,6 +54,16 @@ __PACKAGE__->table("jobsetevals");
|
||||||
is_foreign_key: 1
|
is_foreign_key: 1
|
||||||
is_nullable: 0
|
is_nullable: 0
|
||||||
|
|
||||||
|
=head2 errormsg
|
||||||
|
|
||||||
|
data_type: 'text'
|
||||||
|
is_nullable: 1
|
||||||
|
|
||||||
|
=head2 errortime
|
||||||
|
|
||||||
|
data_type: 'integer'
|
||||||
|
is_nullable: 1
|
||||||
|
|
||||||
=head2 timestamp
|
=head2 timestamp
|
||||||
|
|
||||||
data_type: 'integer'
|
data_type: 'integer'
|
||||||
|
@ -108,6 +118,10 @@ __PACKAGE__->add_columns(
|
||||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||||
"jobset",
|
"jobset",
|
||||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||||
|
"errormsg",
|
||||||
|
{ data_type => "text", is_nullable => 1 },
|
||||||
|
"errortime",
|
||||||
|
{ data_type => "integer", is_nullable => 1 },
|
||||||
"timestamp",
|
"timestamp",
|
||||||
{ data_type => "integer", is_nullable => 0 },
|
{ data_type => "integer", is_nullable => 0 },
|
||||||
"checkouttime",
|
"checkouttime",
|
||||||
|
@ -201,8 +215,8 @@ __PACKAGE__->belongs_to(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-27 17:40:41
|
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 11:13:38
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M61ikfnjORU7jDAH8P/j7w
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zDBtAFc4HiFUcL/TpkuCcg
|
||||||
|
|
||||||
__PACKAGE__->has_many(
|
__PACKAGE__->has_many(
|
||||||
"buildIds",
|
"buildIds",
|
||||||
|
|
|
@ -440,6 +440,9 @@ create table JobsetEvals (
|
||||||
project text not null,
|
project text not null,
|
||||||
jobset text not null,
|
jobset text not null,
|
||||||
|
|
||||||
|
errorMsg text, -- error output from the evaluator
|
||||||
|
errorTime integer, -- timestamp associated with errorMsg
|
||||||
|
|
||||||
timestamp integer not null, -- when this entry was added
|
timestamp integer not null, -- when this entry was added
|
||||||
checkoutTime integer not null, -- how long obtaining the inputs took (in seconds)
|
checkoutTime integer not null, -- how long obtaining the inputs took (in seconds)
|
||||||
evalTime integer not null, -- how long evaluation took (in seconds)
|
evalTime integer not null, -- how long evaluation took (in seconds)
|
||||||
|
|
34
src/sql/upgrade-70.sql
Normal file
34
src/sql/upgrade-70.sql
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
ALTER TABLE JobsetEvals
|
||||||
|
ADD COLUMN errorMsg text,
|
||||||
|
ADD COLUMN errorTime integer NULL;
|
||||||
|
|
||||||
|
-- Copy the current error in jobsets to the latest field in jobsetevals
|
||||||
|
UPDATE jobsetevals
|
||||||
|
SET errorMsg = j.errorMsg,
|
||||||
|
errorTime = j.errorTime
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
jobsets.errorMsg,
|
||||||
|
jobsets.errorTime,
|
||||||
|
jobsets.id AS jobset_id,
|
||||||
|
latesteval.id AS eval_id
|
||||||
|
FROM jobsets
|
||||||
|
LEFT JOIN
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
MAX(id) AS id,
|
||||||
|
project,
|
||||||
|
jobset
|
||||||
|
FROM jobsetevals
|
||||||
|
GROUP BY project, jobset
|
||||||
|
ORDER BY project, jobset
|
||||||
|
)
|
||||||
|
AS latesteval
|
||||||
|
ON
|
||||||
|
jobsets.name = latesteval.jobset
|
||||||
|
AND jobsets.project = latesteval.project
|
||||||
|
WHERE latesteval.id IS NOT NULL
|
||||||
|
ORDER BY jobsets.id
|
||||||
|
)
|
||||||
|
AS j
|
||||||
|
WHERE id = j.eval_id;
|
Loading…
Reference in a new issue