]>
Commit | Line | Data |
---|---|---|
4ed3f8e7 MG |
1 | use utf8; |
2 | package 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 | ||
9 | Gruntmaster::Data::Result::Job | |
10 | ||
11 | =cut | |
12 | ||
13 | use strict; | |
14 | use warnings; | |
15 | ||
16 | use 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 | ||
44 | =head2 date | |
45 | ||
46 | data_type: 'bigint' | |
47 | is_nullable: 0 | |
48 | ||
49 | =head2 errors | |
50 | ||
51 | data_type: 'text' | |
52 | is_nullable: 1 | |
53 | ||
54 | =head2 extension | |
55 | ||
56 | data_type: 'text' | |
57 | is_nullable: 0 | |
58 | ||
59 | =head2 format | |
60 | ||
61 | data_type: 'text' | |
62 | is_nullable: 0 | |
63 | ||
64 | =head2 private | |
65 | ||
66 | data_type: 'boolean' | |
67 | default_value: false | |
68 | is_nullable: 0 | |
69 | ||
70 | =head2 problem | |
71 | ||
72 | data_type: 'text' | |
73 | is_foreign_key: 1 | |
74 | is_nullable: 0 | |
75 | ||
76 | =head2 result | |
77 | ||
78 | data_type: 'integer' | |
79 | is_nullable: 1 | |
80 | ||
81 | =head2 result_text | |
82 | ||
83 | data_type: 'text' | |
84 | is_nullable: 1 | |
85 | ||
86 | =head2 results | |
87 | ||
85d3f015 | 88 | data_type: 'text' |
4ed3f8e7 MG |
89 | is_nullable: 1 |
90 | ||
91 | =head2 source | |
92 | ||
93 | data_type: 'text' | |
94 | is_nullable: 0 | |
95 | ||
96 | =head2 owner | |
97 | ||
98 | data_type: 'text' | |
99 | is_foreign_key: 1 | |
100 | is_nullable: 0 | |
101 | ||
102 | =cut | |
103 | ||
104 | __PACKAGE__->add_columns( | |
105 | "id", | |
106 | { | |
107 | data_type => "integer", | |
108 | is_auto_increment => 1, | |
109 | is_nullable => 0, | |
110 | sequence => "jobs_id_seq", | |
111 | }, | |
112 | "contest", | |
b2725d9d | 113 | { data_type => "text", is_foreign_key => 1, is_nullable => 1 }, |
4ed3f8e7 MG |
114 | "daemon", |
115 | { data_type => "text", is_nullable => 1 }, | |
116 | "date", | |
117 | { data_type => "bigint", is_nullable => 0 }, | |
118 | "errors", | |
119 | { data_type => "text", is_nullable => 1 }, | |
120 | "extension", | |
121 | { data_type => "text", is_nullable => 0 }, | |
122 | "format", | |
123 | { data_type => "text", is_nullable => 0 }, | |
124 | "private", | |
125 | { data_type => "boolean", default_value => \"false", is_nullable => 0 }, | |
126 | "problem", | |
127 | { data_type => "text", is_foreign_key => 1, is_nullable => 0 }, | |
128 | "result", | |
129 | { data_type => "integer", is_nullable => 1 }, | |
130 | "result_text", | |
131 | { data_type => "text", is_nullable => 1 }, | |
132 | "results", | |
85d3f015 | 133 | { data_type => "text", is_nullable => 1 }, |
4ed3f8e7 MG |
134 | "source", |
135 | { data_type => "text", is_nullable => 0 }, | |
136 | "owner", | |
137 | { data_type => "text", is_foreign_key => 1, is_nullable => 0 }, | |
138 | ); | |
139 | ||
140 | =head1 PRIMARY KEY | |
141 | ||
142 | =over 4 | |
143 | ||
144 | =item * L</id> | |
145 | ||
146 | =back | |
147 | ||
148 | =cut | |
149 | ||
150 | __PACKAGE__->set_primary_key("id"); | |
151 | ||
152 | =head1 RELATIONS | |
153 | ||
154 | =head2 contest | |
155 | ||
156 | Type: belongs_to | |
157 | ||
158 | Related object: L<Gruntmaster::Data::Result::Contest> | |
159 | ||
160 | =cut | |
161 | ||
162 | __PACKAGE__->belongs_to( | |
163 | "contest", | |
164 | "Gruntmaster::Data::Result::Contest", | |
165 | { id => "contest" }, | |
b2725d9d MG |
166 | { |
167 | is_deferrable => 0, | |
168 | join_type => "LEFT", | |
9bb39921 | 169 | on_delete => "CASCADE", |
b2725d9d MG |
170 | on_update => "NO ACTION", |
171 | }, | |
4ed3f8e7 MG |
172 | ); |
173 | ||
174 | =head2 owner | |
175 | ||
176 | Type: belongs_to | |
177 | ||
178 | Related object: L<Gruntmaster::Data::Result::User> | |
179 | ||
180 | =cut | |
181 | ||
182 | __PACKAGE__->belongs_to( | |
183 | "owner", | |
184 | "Gruntmaster::Data::Result::User", | |
185 | { id => "owner" }, | |
9bb39921 | 186 | { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, |
4ed3f8e7 MG |
187 | ); |
188 | ||
189 | =head2 problem | |
190 | ||
191 | Type: belongs_to | |
192 | ||
193 | Related object: L<Gruntmaster::Data::Result::Problem> | |
194 | ||
195 | =cut | |
196 | ||
197 | __PACKAGE__->belongs_to( | |
198 | "problem", | |
199 | "Gruntmaster::Data::Result::Problem", | |
200 | { id => "problem" }, | |
9bb39921 | 201 | { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, |
4ed3f8e7 MG |
202 | ); |
203 | ||
204 | ||
9bb39921 MG |
205 | # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32 |
206 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k3Oq7pNqFoCI5NwY5GaWfQ | |
4ed3f8e7 | 207 | |
4a8747ef MG |
208 | sub rerun { |
209 | shift->update({daemon => undef, result => -2, result_text => undef}); | |
210 | } | |
4ed3f8e7 | 211 | |
4ed3f8e7 | 212 | 1; |
4a8747ef MG |
213 | |
214 | __END__ | |
215 | ||
216 | =head1 METHODS | |
217 | ||
218 | =head2 rerun | |
219 | ||
220 | Reruns this job. | |
221 | ||
222 | =head1 AUTHOR | |
223 | ||
224 | Marius Gavrilescu E<lt>marius@ieval.roE<gt> | |
225 | ||
226 | =head1 COPYRIGHT AND LICENSE | |
227 | ||
228 | Copyright (C) 2014 by Marius Gavrilescu | |
229 | ||
230 | This library is free software; you can redistribute it and/or modify | |
231 | it under the same terms as Perl itself, either Perl version 5.18.1 or, | |
232 | at your option, any later version of Perl 5 you may have available. | |
233 | ||
234 | ||
235 | =cut |