Bug 19889: set exclude_from_local_holds_priority columns as boolean in 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 =head2 borrowernumber
32
33   data_type: 'integer'
34   is_foreign_key: 1
35   is_nullable: 1
36
37 =head2 reservedate
38
39   data_type: 'date'
40   datetime_undef_if_invalid: 1
41   is_nullable: 1
42
43 =head2 biblionumber
44
45   data_type: 'integer'
46   is_foreign_key: 1
47   is_nullable: 1
48
49 =head2 branchcode
50
51   data_type: 'varchar'
52   is_nullable: 1
53   size: 10
54
55 =head2 notificationdate
56
57   data_type: 'date'
58   datetime_undef_if_invalid: 1
59   is_nullable: 1
60
61 =head2 reminderdate
62
63   data_type: 'date'
64   datetime_undef_if_invalid: 1
65   is_nullable: 1
66
67 =head2 cancellationdate
68
69   data_type: 'date'
70   datetime_undef_if_invalid: 1
71   is_nullable: 1
72
73 =head2 cancellation_reason
74
75   data_type: 'varchar'
76   is_nullable: 1
77   size: 80
78
79 =head2 reservenotes
80
81   data_type: 'longtext'
82   is_nullable: 1
83
84 =head2 priority
85
86   data_type: 'smallint'
87   default_value: 1
88   is_nullable: 0
89
90 =head2 found
91
92   data_type: 'varchar'
93   is_nullable: 1
94   size: 1
95
96 =head2 timestamp
97
98   data_type: 'timestamp'
99   datetime_undef_if_invalid: 1
100   default_value: current_timestamp
101   is_nullable: 0
102
103 =head2 itemnumber
104
105   data_type: 'integer'
106   is_foreign_key: 1
107   is_nullable: 1
108
109 =head2 waitingdate
110
111   data_type: 'date'
112   datetime_undef_if_invalid: 1
113   is_nullable: 1
114
115 =head2 expirationdate
116
117   data_type: 'date'
118   datetime_undef_if_invalid: 1
119   is_nullable: 1
120
121 =head2 lowestPriority
122
123   accessor: 'lowest_priority'
124   data_type: 'tinyint'
125   default_value: 0
126   is_nullable: 0
127
128 =head2 suspend
129
130   data_type: 'tinyint'
131   default_value: 0
132   is_nullable: 0
133
134 =head2 suspend_until
135
136   data_type: 'datetime'
137   datetime_undef_if_invalid: 1
138   is_nullable: 1
139
140 =head2 itemtype
141
142   data_type: 'varchar'
143   is_foreign_key: 1
144   is_nullable: 1
145   size: 10
146
147 =head2 item_level_hold
148
149   data_type: 'tinyint'
150   default_value: 0
151   is_nullable: 0
152
153 =head2 non_priority
154
155   data_type: 'tinyint'
156   default_value: 0
157   is_nullable: 0
158
159 =cut
160
161 __PACKAGE__->add_columns(
162   "reserve_id",
163   { data_type => "integer", is_nullable => 0 },
164   "borrowernumber",
165   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
166   "reservedate",
167   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
168   "biblionumber",
169   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
170   "branchcode",
171   { data_type => "varchar", is_nullable => 1, size => 10 },
172   "notificationdate",
173   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
174   "reminderdate",
175   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
176   "cancellationdate",
177   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
178   "cancellation_reason",
179   { data_type => "varchar", is_nullable => 1, size => 80 },
180   "reservenotes",
181   { data_type => "longtext", is_nullable => 1 },
182   "priority",
183   { data_type => "smallint", default_value => 1, is_nullable => 0 },
184   "found",
185   { data_type => "varchar", is_nullable => 1, size => 1 },
186   "timestamp",
187   {
188     data_type => "timestamp",
189     datetime_undef_if_invalid => 1,
190     default_value => \"current_timestamp",
191     is_nullable => 0,
192   },
193   "itemnumber",
194   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
195   "waitingdate",
196   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
197   "expirationdate",
198   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
199   "lowestPriority",
200   {
201     accessor      => "lowest_priority",
202     data_type     => "tinyint",
203     default_value => 0,
204     is_nullable   => 0,
205   },
206   "suspend",
207   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
208   "suspend_until",
209   {
210     data_type => "datetime",
211     datetime_undef_if_invalid => 1,
212     is_nullable => 1,
213   },
214   "itemtype",
215   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
216   "item_level_hold",
217   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
218   "non_priority",
219   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
220 );
221
222 =head1 PRIMARY KEY
223
224 =over 4
225
226 =item * L</reserve_id>
227
228 =back
229
230 =cut
231
232 __PACKAGE__->set_primary_key("reserve_id");
233
234 =head1 RELATIONS
235
236 =head2 biblionumber
237
238 Type: belongs_to
239
240 Related object: L<Koha::Schema::Result::Biblio>
241
242 =cut
243
244 __PACKAGE__->belongs_to(
245   "biblionumber",
246   "Koha::Schema::Result::Biblio",
247   { biblionumber => "biblionumber" },
248   {
249     is_deferrable => 1,
250     join_type     => "LEFT",
251     on_delete     => "SET NULL",
252     on_update     => "SET NULL",
253   },
254 );
255
256 =head2 borrowernumber
257
258 Type: belongs_to
259
260 Related object: L<Koha::Schema::Result::Borrower>
261
262 =cut
263
264 __PACKAGE__->belongs_to(
265   "borrowernumber",
266   "Koha::Schema::Result::Borrower",
267   { borrowernumber => "borrowernumber" },
268   {
269     is_deferrable => 1,
270     join_type     => "LEFT",
271     on_delete     => "SET NULL",
272     on_update     => "SET NULL",
273   },
274 );
275
276 =head2 itemnumber
277
278 Type: belongs_to
279
280 Related object: L<Koha::Schema::Result::Item>
281
282 =cut
283
284 __PACKAGE__->belongs_to(
285   "itemnumber",
286   "Koha::Schema::Result::Item",
287   { itemnumber => "itemnumber" },
288   {
289     is_deferrable => 1,
290     join_type     => "LEFT",
291     on_delete     => "SET NULL",
292     on_update     => "SET NULL",
293   },
294 );
295
296 =head2 itemtype
297
298 Type: belongs_to
299
300 Related object: L<Koha::Schema::Result::Itemtype>
301
302 =cut
303
304 __PACKAGE__->belongs_to(
305   "itemtype",
306   "Koha::Schema::Result::Itemtype",
307   { itemtype => "itemtype" },
308   {
309     is_deferrable => 1,
310     join_type     => "LEFT",
311     on_delete     => "SET NULL",
312     on_update     => "SET NULL",
313   },
314 );
315
316
317 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-31 14:16:48
318 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DnOerXRIsIGIRKl9I0HZUQ
319
320 __PACKAGE__->add_columns(
321     '+item_level_hold' => { is_boolean => 1 },
322     '+lowestPriority'  => { is_boolean => 1 },
323     '+suspend'         => { is_boolean => 1 },
324     '+non_priority'    => { is_boolean => 1 }
325 );
326
327 sub koha_object_class {
328     'Koha::Old::Hold';
329 }
330 sub koha_objects_class {
331     'Koha::Old::Holds';
332 }
333
334 1;