Bug 19618: DBRev 19.06.00.030
[koha.git] / Koha / Schema / Result / Reserve.pm
blob3a56d68e21f338726b024b40df5cc16cf9be27b9
1 use utf8;
2 package Koha::Schema::Result::Reserve;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Reserve
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<reserves>
20 =cut
22 __PACKAGE__->table("reserves");
24 =head1 ACCESSORS
26 =head2 reserve_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 borrowernumber
34 data_type: 'integer'
35 default_value: 0
36 is_foreign_key: 1
37 is_nullable: 0
39 =head2 reservedate
41 data_type: 'date'
42 datetime_undef_if_invalid: 1
43 is_nullable: 1
45 =head2 biblionumber
47 data_type: 'integer'
48 default_value: 0
49 is_foreign_key: 1
50 is_nullable: 0
52 =head2 branchcode
54 data_type: 'varchar'
55 is_foreign_key: 1
56 is_nullable: 1
57 size: 10
59 =head2 notificationdate
61 data_type: 'date'
62 datetime_undef_if_invalid: 1
63 is_nullable: 1
65 =head2 reminderdate
67 data_type: 'date'
68 datetime_undef_if_invalid: 1
69 is_nullable: 1
71 =head2 cancellationdate
73 data_type: 'date'
74 datetime_undef_if_invalid: 1
75 is_nullable: 1
77 =head2 reservenotes
79 data_type: 'longtext'
80 is_nullable: 1
82 =head2 priority
84 data_type: 'smallint'
85 is_nullable: 1
87 =head2 found
89 data_type: 'varchar'
90 is_nullable: 1
91 size: 1
93 =head2 timestamp
95 data_type: 'timestamp'
96 datetime_undef_if_invalid: 1
97 default_value: current_timestamp
98 is_nullable: 0
100 =head2 itemnumber
102 data_type: 'integer'
103 is_foreign_key: 1
104 is_nullable: 1
106 =head2 waitingdate
108 data_type: 'date'
109 datetime_undef_if_invalid: 1
110 is_nullable: 1
112 =head2 expirationdate
114 data_type: 'date'
115 datetime_undef_if_invalid: 1
116 is_nullable: 1
118 =head2 lowestPriority
120 accessor: 'lowest_priority'
121 data_type: 'tinyint'
122 default_value: 0
123 is_nullable: 0
125 =head2 suspend
127 data_type: 'tinyint'
128 default_value: 0
129 is_nullable: 0
131 =head2 suspend_until
133 data_type: 'datetime'
134 datetime_undef_if_invalid: 1
135 is_nullable: 1
137 =head2 itemtype
139 data_type: 'varchar'
140 is_foreign_key: 1
141 is_nullable: 1
142 size: 10
144 =head2 item_level_hold
146 data_type: 'tinyint'
147 default_value: 0
148 is_nullable: 0
150 =cut
152 __PACKAGE__->add_columns(
153 "reserve_id",
154 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
155 "borrowernumber",
157 data_type => "integer",
158 default_value => 0,
159 is_foreign_key => 1,
160 is_nullable => 0,
162 "reservedate",
163 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
164 "biblionumber",
166 data_type => "integer",
167 default_value => 0,
168 is_foreign_key => 1,
169 is_nullable => 0,
171 "branchcode",
172 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
173 "notificationdate",
174 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
175 "reminderdate",
176 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
177 "cancellationdate",
178 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
179 "reservenotes",
180 { data_type => "longtext", is_nullable => 1 },
181 "priority",
182 { data_type => "smallint", is_nullable => 1 },
183 "found",
184 { data_type => "varchar", is_nullable => 1, size => 1 },
185 "timestamp",
187 data_type => "timestamp",
188 datetime_undef_if_invalid => 1,
189 default_value => \"current_timestamp",
190 is_nullable => 0,
192 "itemnumber",
193 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
194 "waitingdate",
195 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
196 "expirationdate",
197 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
198 "lowestPriority",
200 accessor => "lowest_priority",
201 data_type => "tinyint",
202 default_value => 0,
203 is_nullable => 0,
205 "suspend",
206 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
207 "suspend_until",
209 data_type => "datetime",
210 datetime_undef_if_invalid => 1,
211 is_nullable => 1,
213 "itemtype",
214 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
215 "item_level_hold",
216 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
219 =head1 PRIMARY KEY
221 =over 4
223 =item * L</reserve_id>
225 =back
227 =cut
229 __PACKAGE__->set_primary_key("reserve_id");
231 =head1 RELATIONS
233 =head2 biblionumber
235 Type: belongs_to
237 Related object: L<Koha::Schema::Result::Biblio>
239 =cut
241 __PACKAGE__->belongs_to(
242 "biblionumber",
243 "Koha::Schema::Result::Biblio",
244 { biblionumber => "biblionumber" },
245 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
248 =head2 borrowernumber
250 Type: belongs_to
252 Related object: L<Koha::Schema::Result::Borrower>
254 =cut
256 __PACKAGE__->belongs_to(
257 "borrowernumber",
258 "Koha::Schema::Result::Borrower",
259 { borrowernumber => "borrowernumber" },
260 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
263 =head2 branchcode
265 Type: belongs_to
267 Related object: L<Koha::Schema::Result::Branch>
269 =cut
271 __PACKAGE__->belongs_to(
272 "branchcode",
273 "Koha::Schema::Result::Branch",
274 { branchcode => "branchcode" },
276 is_deferrable => 1,
277 join_type => "LEFT",
278 on_delete => "CASCADE",
279 on_update => "CASCADE",
283 =head2 club_holds_to_patron_holds
285 Type: has_many
287 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
289 =cut
291 __PACKAGE__->has_many(
292 "club_holds_to_patron_holds",
293 "Koha::Schema::Result::ClubHoldsToPatronHold",
294 { "foreign.hold_id" => "self.reserve_id" },
295 { cascade_copy => 0, cascade_delete => 0 },
298 =head2 itemnumber
300 Type: belongs_to
302 Related object: L<Koha::Schema::Result::Item>
304 =cut
306 __PACKAGE__->belongs_to(
307 "itemnumber",
308 "Koha::Schema::Result::Item",
309 { itemnumber => "itemnumber" },
311 is_deferrable => 1,
312 join_type => "LEFT",
313 on_delete => "CASCADE",
314 on_update => "CASCADE",
318 =head2 itemtype
320 Type: belongs_to
322 Related object: L<Koha::Schema::Result::Itemtype>
324 =cut
326 __PACKAGE__->belongs_to(
327 "itemtype",
328 "Koha::Schema::Result::Itemtype",
329 { itemtype => "itemtype" },
331 is_deferrable => 1,
332 join_type => "LEFT",
333 on_delete => "CASCADE",
334 on_update => "CASCADE",
339 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:48
340 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pc5zh5iFbdwko5KS51Y9Uw
342 __PACKAGE__->belongs_to(
343 "item",
344 "Koha::Schema::Result::Item",
345 { itemnumber => "itemnumber" },
347 is_deferrable => 1,
348 join_type => "LEFT",
349 on_delete => "CASCADE",
350 on_update => "CASCADE",
354 __PACKAGE__->belongs_to(
355 "biblio",
356 "Koha::Schema::Result::Biblio",
357 { biblionumber => "biblionumber" },
359 is_deferrable => 1,
360 join_type => "LEFT",
361 on_delete => "CASCADE",
362 on_update => "CASCADE",
366 __PACKAGE__->add_columns(
367 '+item_level_hold' => { is_boolean => 1 },
368 '+lowestPriority' => { is_boolean => 1 },
369 '+suspend' => { is_boolean => 1 }
372 sub koha_object_class {
373 'Koha::Hold';
375 sub koha_objects_class {
376 'Koha::Holds';