Bug 21729: Update DBIC schema
[koha.git] / Koha / Schema / Result / OldReserve.pm
1 use utf8;
2 package Koha::Schema::Result::OldReserve;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::OldReserve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<old_reserves>
19
20 =cut
21
22 __PACKAGE__->table("old_reserves");
23
24 =head1 ACCESSORS
25
26 =head2 reserve_id
27
28   data_type: 'integer'
29   is_nullable: 0
30
31 primary key
32
33 =head2 borrowernumber
34
35   data_type: 'integer'
36   is_foreign_key: 1
37   is_nullable: 1
38
39 foreign key from the borrowers table defining which patron this hold is for
40
41 =head2 reservedate
42
43   data_type: 'date'
44   datetime_undef_if_invalid: 1
45   is_nullable: 1
46
47 the date the hold was places
48
49 =head2 biblionumber
50
51   data_type: 'integer'
52   is_foreign_key: 1
53   is_nullable: 1
54
55 foreign key from the biblio table defining which bib record this hold is on
56
57 =head2 branchcode
58
59   data_type: 'varchar'
60   is_nullable: 1
61   size: 10
62
63 foreign key from the branches table defining which branch the patron wishes to pick this hold up at
64
65 =head2 desk_id
66
67   data_type: 'integer'
68   is_nullable: 1
69
70 foreign key from the desks table defining which desk the patron should pick this hold up at
71
72 =head2 notificationdate
73
74   data_type: 'date'
75   datetime_undef_if_invalid: 1
76   is_nullable: 1
77
78 currently unused
79
80 =head2 reminderdate
81
82   data_type: 'date'
83   datetime_undef_if_invalid: 1
84   is_nullable: 1
85
86 currently unused
87
88 =head2 cancellationdate
89
90   data_type: 'date'
91   datetime_undef_if_invalid: 1
92   is_nullable: 1
93
94 the date this hold was cancelled
95
96 =head2 cancellation_reason
97
98   data_type: 'varchar'
99   is_nullable: 1
100   size: 80
101
102 optional authorised value CANCELLATION_REASON
103
104 =head2 reservenotes
105
106   data_type: 'longtext'
107   is_nullable: 1
108
109 notes related to this hold
110
111 =head2 priority
112
113   data_type: 'smallint'
114   default_value: 1
115   is_nullable: 0
116
117 where in the queue the patron sits
118
119 =head2 found
120
121   data_type: 'varchar'
122   is_nullable: 1
123   size: 1
124
125 a one letter code defining what the status is of the hold is after it has been confirmed
126
127 =head2 timestamp
128
129   data_type: 'timestamp'
130   datetime_undef_if_invalid: 1
131   default_value: current_timestamp
132   is_nullable: 0
133
134 the date and time this hold was last updated
135
136 =head2 itemnumber
137
138   data_type: 'integer'
139   is_foreign_key: 1
140   is_nullable: 1
141
142 foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
143
144 =head2 waitingdate
145
146   data_type: 'date'
147   datetime_undef_if_invalid: 1
148   is_nullable: 1
149
150 the date the item was marked as waiting for the patron at the library
151
152 =head2 expirationdate
153
154   data_type: 'date'
155   datetime_undef_if_invalid: 1
156   is_nullable: 1
157
158 the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date)
159
160 =head2 patron_expiration_date
161
162   data_type: 'date'
163   datetime_undef_if_invalid: 1
164   is_nullable: 1
165
166 the date the hold expires - usually the date entered by the patron to say they don't need the hold after a certain date
167
168 =head2 lowestPriority
169
170   accessor: 'lowest_priority'
171   data_type: 'tinyint'
172   default_value: 0
173   is_nullable: 0
174
175 has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)
176
177 =head2 suspend
178
179   data_type: 'tinyint'
180   default_value: 0
181   is_nullable: 0
182
183 in this hold suspended (1 for yes, 0 for no)
184
185 =head2 suspend_until
186
187   data_type: 'datetime'
188   datetime_undef_if_invalid: 1
189   is_nullable: 1
190
191 the date this hold is suspended until (NULL for infinitely)
192
193 =head2 itemtype
194
195   data_type: 'varchar'
196   is_foreign_key: 1
197   is_nullable: 1
198   size: 10
199
200 If record level hold, the optional itemtype of the item the patron is requesting
201
202 =head2 item_level_hold
203
204   data_type: 'tinyint'
205   default_value: 0
206   is_nullable: 0
207
208 Is the hpld placed at item level
209
210 =head2 non_priority
211
212   data_type: 'tinyint'
213   default_value: 0
214   is_nullable: 0
215
216 Is this a non priority hold
217
218 =cut
219
220 __PACKAGE__->add_columns(
221   "reserve_id",
222   { data_type => "integer", is_nullable => 0 },
223   "borrowernumber",
224   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
225   "reservedate",
226   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
227   "biblionumber",
228   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
229   "branchcode",
230   { data_type => "varchar", is_nullable => 1, size => 10 },
231   "desk_id",
232   { data_type => "integer", is_nullable => 1 },
233   "notificationdate",
234   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
235   "reminderdate",
236   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
237   "cancellationdate",
238   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
239   "cancellation_reason",
240   { data_type => "varchar", is_nullable => 1, size => 80 },
241   "reservenotes",
242   { data_type => "longtext", is_nullable => 1 },
243   "priority",
244   { data_type => "smallint", default_value => 1, is_nullable => 0 },
245   "found",
246   { data_type => "varchar", is_nullable => 1, size => 1 },
247   "timestamp",
248   {
249     data_type => "timestamp",
250     datetime_undef_if_invalid => 1,
251     default_value => \"current_timestamp",
252     is_nullable => 0,
253   },
254   "itemnumber",
255   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
256   "waitingdate",
257   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
258   "expirationdate",
259   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
260   "patron_expiration_date",
261   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
262   "lowestPriority",
263   {
264     accessor      => "lowest_priority",
265     data_type     => "tinyint",
266     default_value => 0,
267     is_nullable   => 0,
268   },
269   "suspend",
270   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
271   "suspend_until",
272   {
273     data_type => "datetime",
274     datetime_undef_if_invalid => 1,
275     is_nullable => 1,
276   },
277   "itemtype",
278   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
279   "item_level_hold",
280   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
281   "non_priority",
282   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
283 );
284
285 =head1 PRIMARY KEY
286
287 =over 4
288
289 =item * L</reserve_id>
290
291 =back
292
293 =cut
294
295 __PACKAGE__->set_primary_key("reserve_id");
296
297 =head1 RELATIONS
298
299 =head2 biblionumber
300
301 Type: belongs_to
302
303 Related object: L<Koha::Schema::Result::Biblio>
304
305 =cut
306
307 __PACKAGE__->belongs_to(
308   "biblionumber",
309   "Koha::Schema::Result::Biblio",
310   { biblionumber => "biblionumber" },
311   {
312     is_deferrable => 1,
313     join_type     => "LEFT",
314     on_delete     => "SET NULL",
315     on_update     => "SET NULL",
316   },
317 );
318
319 =head2 borrowernumber
320
321 Type: belongs_to
322
323 Related object: L<Koha::Schema::Result::Borrower>
324
325 =cut
326
327 __PACKAGE__->belongs_to(
328   "borrowernumber",
329   "Koha::Schema::Result::Borrower",
330   { borrowernumber => "borrowernumber" },
331   {
332     is_deferrable => 1,
333     join_type     => "LEFT",
334     on_delete     => "SET NULL",
335     on_update     => "SET NULL",
336   },
337 );
338
339 =head2 itemnumber
340
341 Type: belongs_to
342
343 Related object: L<Koha::Schema::Result::Item>
344
345 =cut
346
347 __PACKAGE__->belongs_to(
348   "itemnumber",
349   "Koha::Schema::Result::Item",
350   { itemnumber => "itemnumber" },
351   {
352     is_deferrable => 1,
353     join_type     => "LEFT",
354     on_delete     => "SET NULL",
355     on_update     => "SET NULL",
356   },
357 );
358
359 =head2 itemtype
360
361 Type: belongs_to
362
363 Related object: L<Koha::Schema::Result::Itemtype>
364
365 =cut
366
367 __PACKAGE__->belongs_to(
368   "itemtype",
369   "Koha::Schema::Result::Itemtype",
370   { itemtype => "itemtype" },
371   {
372     is_deferrable => 1,
373     join_type     => "LEFT",
374     on_delete     => "SET NULL",
375     on_update     => "SET NULL",
376   },
377 );
378
379
380 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:08:09
381 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A3iHpf4nDeIpPsapNzdv8w
382
383 __PACKAGE__->belongs_to(
384   "item",
385   "Koha::Schema::Result::Item",
386   { itemnumber => "itemnumber" },
387   {
388     is_deferrable => 1,
389     join_type     => "LEFT",
390     on_delete     => "CASCADE",
391     on_update     => "CASCADE",
392   },
393 );
394
395 __PACKAGE__->belongs_to(
396   "biblio",
397   "Koha::Schema::Result::Biblio",
398   { biblionumber => "biblionumber" },
399   {
400     is_deferrable => 1,
401     join_type     => "LEFT",
402     on_delete     => "CASCADE",
403     on_update     => "CASCADE",
404   },
405 );
406
407 __PACKAGE__->add_columns(
408     '+item_level_hold' => { is_boolean => 1 },
409     '+lowestPriority'  => { is_boolean => 1 },
410     '+suspend'         => { is_boolean => 1 },
411     '+non_priority'    => { is_boolean => 1 }
412 );
413
414 sub koha_object_class {
415     'Koha::Old::Hold';
416 }
417 sub koha_objects_class {
418     'Koha::Old::Holds';
419 }
420
421 1;