Bug 24474: (QA follow-up) Fix failing test
[koha.git] / Koha / Schema / Result / Issue.pm
blob8bb16b6b92dab33db8f57714245a14920861edcb
1 use utf8;
2 package Koha::Schema::Result::Issue;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Issue
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<issues>
20 =cut
22 __PACKAGE__->table("issues");
24 =head1 ACCESSORS
26 =head2 issue_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 borrowernumber
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 1
38 =head2 itemnumber
40 data_type: 'integer'
41 is_foreign_key: 1
42 is_nullable: 1
44 =head2 date_due
46 data_type: 'datetime'
47 datetime_undef_if_invalid: 1
48 is_nullable: 1
50 =head2 branchcode
52 data_type: 'varchar'
53 is_nullable: 1
54 size: 10
56 =head2 returndate
58 data_type: 'datetime'
59 datetime_undef_if_invalid: 1
60 is_nullable: 1
62 =head2 lastreneweddate
64 data_type: 'datetime'
65 datetime_undef_if_invalid: 1
66 is_nullable: 1
68 =head2 renewals
70 data_type: 'tinyint'
71 default_value: 0
72 is_nullable: 0
74 =head2 auto_renew
76 data_type: 'tinyint'
77 default_value: 0
78 is_nullable: 1
80 =head2 auto_renew_error
82 data_type: 'varchar'
83 is_nullable: 1
84 size: 32
86 =head2 timestamp
88 data_type: 'timestamp'
89 datetime_undef_if_invalid: 1
90 default_value: current_timestamp
91 is_nullable: 0
93 =head2 issuedate
95 data_type: 'datetime'
96 datetime_undef_if_invalid: 1
97 is_nullable: 1
99 =head2 onsite_checkout
101 data_type: 'integer'
102 default_value: 0
103 is_nullable: 0
105 =head2 note
107 data_type: 'longtext'
108 is_nullable: 1
110 =head2 notedate
112 data_type: 'datetime'
113 datetime_undef_if_invalid: 1
114 is_nullable: 1
116 =head2 noteseen
118 data_type: 'integer'
119 is_nullable: 1
121 =cut
123 __PACKAGE__->add_columns(
124 "issue_id",
125 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
126 "borrowernumber",
127 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
128 "itemnumber",
129 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
130 "date_due",
132 data_type => "datetime",
133 datetime_undef_if_invalid => 1,
134 is_nullable => 1,
136 "branchcode",
137 { data_type => "varchar", is_nullable => 1, size => 10 },
138 "returndate",
140 data_type => "datetime",
141 datetime_undef_if_invalid => 1,
142 is_nullable => 1,
144 "lastreneweddate",
146 data_type => "datetime",
147 datetime_undef_if_invalid => 1,
148 is_nullable => 1,
150 "renewals",
151 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
152 "auto_renew",
153 { data_type => "tinyint", default_value => 0, is_nullable => 1 },
154 "auto_renew_error",
155 { data_type => "varchar", is_nullable => 1, size => 32 },
156 "timestamp",
158 data_type => "timestamp",
159 datetime_undef_if_invalid => 1,
160 default_value => \"current_timestamp",
161 is_nullable => 0,
163 "issuedate",
165 data_type => "datetime",
166 datetime_undef_if_invalid => 1,
167 is_nullable => 1,
169 "onsite_checkout",
170 { data_type => "integer", default_value => 0, is_nullable => 0 },
171 "note",
172 { data_type => "longtext", is_nullable => 1 },
173 "notedate",
175 data_type => "datetime",
176 datetime_undef_if_invalid => 1,
177 is_nullable => 1,
179 "noteseen",
180 { data_type => "integer", is_nullable => 1 },
183 =head1 PRIMARY KEY
185 =over 4
187 =item * L</issue_id>
189 =back
191 =cut
193 __PACKAGE__->set_primary_key("issue_id");
195 =head1 UNIQUE CONSTRAINTS
197 =head2 C<itemnumber>
199 =over 4
201 =item * L</itemnumber>
203 =back
205 =cut
207 __PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]);
209 =head1 RELATIONS
211 =head2 borrowernumber
213 Type: belongs_to
215 Related object: L<Koha::Schema::Result::Borrower>
217 =cut
219 __PACKAGE__->belongs_to(
220 "borrowernumber",
221 "Koha::Schema::Result::Borrower",
222 { borrowernumber => "borrowernumber" },
224 is_deferrable => 1,
225 join_type => "LEFT",
226 on_delete => "RESTRICT",
227 on_update => "CASCADE",
231 =head2 itemnumber
233 Type: belongs_to
235 Related object: L<Koha::Schema::Result::Item>
237 =cut
239 __PACKAGE__->belongs_to(
240 "itemnumber",
241 "Koha::Schema::Result::Item",
242 { itemnumber => "itemnumber" },
244 is_deferrable => 1,
245 join_type => "LEFT",
246 on_delete => "RESTRICT",
247 on_update => "CASCADE",
251 =head2 return_claim
253 Type: might_have
255 Related object: L<Koha::Schema::Result::ReturnClaim>
257 =cut
259 __PACKAGE__->might_have(
260 "return_claim",
261 "Koha::Schema::Result::ReturnClaim",
262 { "foreign.issue_id" => "self.issue_id" },
263 { cascade_copy => 0, cascade_delete => 0 },
267 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-31 12:18:38
268 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QVmFa5b0Pe5OhUI92n9kzQ
270 __PACKAGE__->add_columns(
271 '+auto_renew' => { is_boolean => 1 },
272 '+onsite_checkout' => { is_boolean => 1 }
275 __PACKAGE__->belongs_to(
276 "borrower",
277 "Koha::Schema::Result::Borrower",
278 { borrowernumber => "borrowernumber" },
279 { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
282 __PACKAGE__->belongs_to(
283 "item",
284 "Koha::Schema::Result::Item",
285 { itemnumber => "itemnumber" },
287 is_deferrable => 1,
288 join_type => "LEFT",
289 on_delete => "CASCADE",
290 on_update => "CASCADE",
294 __PACKAGE__->belongs_to(
295 "branch",
296 "Koha::Schema::Result::Branch",
297 { branchcode => "branchcode" },
299 is_deferrable => 1,
300 join_type => "LEFT",
301 on_delete => "CASCADE",
302 on_update => "CASCADE",
306 sub koha_object_class {
307 'Koha::Checkout';
309 sub koha_objects_class {
310 'Koha::Checkouts';