Add table and column comments
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Job.pm
CommitLineData
4ed3f8e7
MG
1use utf8;
2package Gruntmaster::Data::Result::Job;
3
4# Created by DBIx::Class::Schema::Loader
5# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7=head1 NAME
8
be2f7678 9Gruntmaster::Data::Result::Job - List of jobs
4ed3f8e7
MG
10
11=cut
12
13use strict;
14use warnings;
15
16use base 'DBIx::Class::Core';
17
18=head1 TABLE: C<jobs>
19
20=cut
21
22__PACKAGE__->table("jobs");
23
24=head1 ACCESSORS
25
26=head2 id
27
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
31 sequence: 'jobs_id_seq'
32
33=head2 contest
34
35 data_type: 'text'
36 is_foreign_key: 1
b2725d9d 37 is_nullable: 1
4ed3f8e7
MG
38
39=head2 daemon
40
41 data_type: 'text'
42 is_nullable: 1
43
be2f7678
MG
44hostname:PID of daemon that last executed this job. NULL if never executed
45
4ed3f8e7
MG
46=head2 date
47
48 data_type: 'bigint'
49 is_nullable: 0
50
be2f7678
MG
51Unix time when job was submitted
52
4ed3f8e7
MG
53=head2 errors
54
55 data_type: 'text'
56 is_nullable: 1
57
be2f7678
MG
58Compiler errors
59
4ed3f8e7
MG
60=head2 extension
61
62 data_type: 'text'
63 is_nullable: 0
64
be2f7678
MG
65File extension of submitted program, without a leading dot
66
4ed3f8e7
MG
67=head2 format
68
69 data_type: 'text'
70 is_nullable: 0
71
be2f7678
MG
72Format (programming language) of submitted program
73
4ed3f8e7
MG
74=head2 private
75
76 data_type: 'boolean'
77 default_value: false
78 is_nullable: 0
79
80=head2 problem
81
82 data_type: 'text'
83 is_foreign_key: 1
84 is_nullable: 0
85
86=head2 result
87
88 data_type: 'integer'
89 is_nullable: 1
90
be2f7678
MG
91Job result (integer constant from Gruntmaster::Daemon::Constants)
92
4ed3f8e7
MG
93=head2 result_text
94
95 data_type: 'text'
96 is_nullable: 1
97
be2f7678
MG
98Job result (human-readable text)
99
4ed3f8e7
MG
100=head2 results
101
85d3f015 102 data_type: 'text'
4ed3f8e7
MG
103 is_nullable: 1
104
be2f7678
MG
105Per-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))
106
4ed3f8e7
MG
107=head2 source
108
109 data_type: 'text'
110 is_nullable: 0
111
112=head2 owner
113
114 data_type: 'text'
115 is_foreign_key: 1
116 is_nullable: 0
117
118=cut
119
120__PACKAGE__->add_columns(
121 "id",
122 {
123 data_type => "integer",
124 is_auto_increment => 1,
125 is_nullable => 0,
126 sequence => "jobs_id_seq",
127 },
128 "contest",
b2725d9d 129 { data_type => "text", is_foreign_key => 1, is_nullable => 1 },
4ed3f8e7
MG
130 "daemon",
131 { data_type => "text", is_nullable => 1 },
132 "date",
133 { data_type => "bigint", is_nullable => 0 },
134 "errors",
135 { data_type => "text", is_nullable => 1 },
136 "extension",
137 { data_type => "text", is_nullable => 0 },
138 "format",
139 { data_type => "text", is_nullable => 0 },
140 "private",
141 { data_type => "boolean", default_value => \"false", is_nullable => 0 },
142 "problem",
143 { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
144 "result",
145 { data_type => "integer", is_nullable => 1 },
146 "result_text",
147 { data_type => "text", is_nullable => 1 },
148 "results",
85d3f015 149 { data_type => "text", is_nullable => 1 },
4ed3f8e7
MG
150 "source",
151 { data_type => "text", is_nullable => 0 },
152 "owner",
153 { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
154);
155
156=head1 PRIMARY KEY
157
158=over 4
159
160=item * L</id>
161
162=back
163
164=cut
165
166__PACKAGE__->set_primary_key("id");
167
168=head1 RELATIONS
169
170=head2 contest
171
172Type: belongs_to
173
174Related object: L<Gruntmaster::Data::Result::Contest>
175
176=cut
177
178__PACKAGE__->belongs_to(
179 "contest",
180 "Gruntmaster::Data::Result::Contest",
181 { id => "contest" },
b2725d9d
MG
182 {
183 is_deferrable => 0,
184 join_type => "LEFT",
9bb39921 185 on_delete => "CASCADE",
b2725d9d
MG
186 on_update => "NO ACTION",
187 },
4ed3f8e7
MG
188);
189
190=head2 owner
191
192Type: belongs_to
193
194Related object: L<Gruntmaster::Data::Result::User>
195
196=cut
197
198__PACKAGE__->belongs_to(
199 "owner",
200 "Gruntmaster::Data::Result::User",
201 { id => "owner" },
9bb39921 202 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
4ed3f8e7
MG
203);
204
205=head2 problem
206
207Type: belongs_to
208
209Related object: L<Gruntmaster::Data::Result::Problem>
210
211=cut
212
213__PACKAGE__->belongs_to(
214 "problem",
215 "Gruntmaster::Data::Result::Problem",
216 { id => "problem" },
9bb39921 217 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
4ed3f8e7
MG
218);
219
adb42d4d 220=head2 problem_statuses
4ed3f8e7 221
adb42d4d
MG
222Type: has_many
223
224Related object: L<Gruntmaster::Data::Result::ProblemStatus>
225
226=cut
227
228__PACKAGE__->has_many(
229 "problem_statuses",
230 "Gruntmaster::Data::Result::ProblemStatus",
231 { "foreign.job" => "self.id" },
232 { cascade_copy => 0, cascade_delete => 0 },
233);
234
235
be2f7678
MG
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
4ed3f8e7 238
a2aa46e6
MG
239sub rawcontest { shift->get_column('contest') }
240sub rawowner { shift->get_column('owner') }
241sub rawproblem { shift->get_column('problem') }
242
4a8747ef
MG
243sub rerun {
244 shift->update({daemon => undef, result => -2, result_text => undef});
245}
4ed3f8e7 246
4ed3f8e7 2471;
4a8747ef
MG
248
249__END__
250
251=head1 METHODS
252
253=head2 rerun
254
255Reruns this job.
256
257=head1 AUTHOR
258
259Marius Gavrilescu E<lt>marius@ieval.roE<gt>
260
261=head1 COPYRIGHT AND LICENSE
262
263Copyright (C) 2014 by Marius Gavrilescu
264
265This library is free software; you can redistribute it and/or modify
266it under the same terms as Perl itself, either Perl version 5.18.1 or,
267at your option, any later version of Perl 5 you may have available.
268
269
270=cut
This page took 0.02742 seconds and 4 git commands to generate.