]>
iEval git - gruntmaster-data.git/blob - Data/Result/Job.pm
2 package Gruntmaster
:: Data
:: Result
:: Job
;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Gruntmaster::Data::Result::Job - List of jobs
16 use base
'DBIx::Class::Core' ;
22 __PACKAGE__
-> table ( "jobs" );
31 sequence: 'jobs_id_seq'
44 hostname:PID of daemon that last executed this job. NULL if never executed
51 Unix time when job was submitted
65 File extension of submitted program, without a leading dot
72 Format (programming language) of submitted program
91 Job result (integer constant from Gruntmaster::Daemon::Constants)
98 Job result (human-readable text)
105 Per-test results (JSON array of hashes with keys id (test number, counting from 1), result (integer constant from Gruntmaster::Daemon::Constants), result_text (human-readable text), time (execution time in decimal seconds))
120 __PACKAGE__
-> add_columns (
123 data_type
=> "integer" ,
124 is_auto_increment
=> 1 ,
126 sequence
=> "jobs_id_seq" ,
129 { data_type
=> "text" , is_foreign_key
=> 1 , is_nullable
=> 1 },
131 { data_type
=> "text" , is_nullable
=> 1 },
133 { data_type
=> "bigint" , is_nullable
=> 0 },
135 { data_type
=> "text" , is_nullable
=> 1 },
137 { data_type
=> "text" , is_nullable
=> 0 },
139 { data_type
=> "text" , is_nullable
=> 0 },
141 { data_type
=> "boolean" , default_value
=> \" false
", is_nullable => 0 },
143 { data_type => " text
", is_foreign_key => 1, is_nullable => 0 },
145 { data_type => " integer
", is_nullable => 1 },
147 { data_type => " text
", is_nullable => 1 },
149 { data_type => " text
", is_nullable => 1 },
151 { data_type => " text
", is_nullable => 0 },
153 { data_type => " text
", is_foreign_key => 1, is_nullable => 0 },
166 __PACKAGE__->set_primary_key(" id
");
174 Related object: L<Gruntmaster::Data::Result::Contest>
178 __PACKAGE__->belongs_to(
180 " Gruntmaster
:: Data
:: Result
:: Contest
",
185 on_delete => " CASCADE
",
186 on_update => " NO ACTION
",
194 Related object: L<Gruntmaster::Data::Result::User>
198 __PACKAGE__->belongs_to(
200 " Gruntmaster
:: Data
:: Result
:: User
",
202 { is_deferrable => 0, on_delete => " CASCADE
", on_update => " NO ACTION
" },
209 Related object: L<Gruntmaster::Data::Result::Problem>
213 __PACKAGE__->belongs_to(
215 " Gruntmaster
:: Data
:: Result
:: Problem
",
217 { is_deferrable => 0, on_delete => " CASCADE
", on_update => " NO ACTION
" },
220 =head2 problem_statuses
224 Related object: L<Gruntmaster::Data::Result::ProblemStatus>
228 __PACKAGE__->has_many(
230 " Gruntmaster
:: Data
:: Result
:: ProblemStatus
",
231 { " foreign
. job
" => " self
. id
" },
232 { cascade_copy => 0, cascade_delete => 0 },
236 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
237 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hEAVL5heV13+nalSmgr0WA
239 use Class::Method::Modifiers qw/after/;
241 sub rawcontest { shift->get_column('contest') }
242 sub rawowner { shift->get_column('owner') }
243 sub rawproblem { shift->get_column('problem') }
246 shift->update({daemon => undef, result => -2, result_text => undef});
249 after qw/insert update delete/ => sub {
251 Gruntmaster::Data::purge '/us/';
252 Gruntmaster::Data::purge '/us/' . $self ->rawowner;
253 Gruntmaster::Data::purge '/st/' . $self ->rawcontest if $self ->rawcontest;
254 Gruntmaster::Data::purge '/log/';
255 Gruntmaster::Data::purge '/log/' . $self ->id;
270 Marius Gavrilescu E<lt>marius @ieval .roE<gt>
272 =head1 COPYRIGHT AND LICENSE
274 Copyright (C) 2014 by Marius Gavrilescu
276 This library is free software; you can redistribute it and/or modify
277 it under the same terms as Perl itself, either Perl version 5.18.1 or,
278 at your option, any later version of Perl 5 you may have available.
This page took 0.067921 seconds and 4 git commands to generate.