8b91618210e3ec12f7d15e0f86d4e2f2c1d02a4e
[koha-equinox.git] / Koha / Schema / Result / Reserve.pm
1 use utf8;
2 package Koha::Schema::Result::Reserve;
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::Reserve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<reserves>
19
20 =cut
21
22 __PACKAGE__->table("reserves");
23
24 =head1 ACCESSORS
25
26 =head2 reserve_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 borrowernumber
33
34   data_type: 'integer'
35   default_value: 0
36   is_foreign_key: 1
37   is_nullable: 0
38
39 =head2 reservedate
40
41   data_type: 'date'
42   datetime_undef_if_invalid: 1
43   is_nullable: 1
44
45 =head2 biblionumber
46
47   data_type: 'integer'
48   default_value: 0
49   is_foreign_key: 1
50   is_nullable: 0
51
52 =head2 branchcode
53
54   data_type: 'varchar'
55   is_foreign_key: 1
56   is_nullable: 1
57   size: 10
58
59 =head2 notificationdate
60
61   data_type: 'date'
62   datetime_undef_if_invalid: 1
63   is_nullable: 1
64
65 =head2 reminderdate
66
67   data_type: 'date'
68   datetime_undef_if_invalid: 1
69   is_nullable: 1
70
71 =head2 cancellationdate
72
73   data_type: 'date'
74   datetime_undef_if_invalid: 1
75   is_nullable: 1
76
77 =head2 reservenotes
78
79   data_type: 'longtext'
80   is_nullable: 1
81
82 =head2 priority
83
84   data_type: 'smallint'
85   is_nullable: 1
86
87 =head2 found
88
89   data_type: 'varchar'
90   is_nullable: 1
91   size: 1
92
93 =head2 timestamp
94
95   data_type: 'timestamp'
96   datetime_undef_if_invalid: 1
97   default_value: current_timestamp
98   is_nullable: 0
99
100 =head2 itemnumber
101
102   data_type: 'integer'
103   is_foreign_key: 1
104   is_nullable: 1
105
106 =head2 waitingdate
107
108   data_type: 'date'
109   datetime_undef_if_invalid: 1
110   is_nullable: 1
111
112 =head2 expirationdate
113
114   data_type: 'date'
115   datetime_undef_if_invalid: 1
116   is_nullable: 1
117
118 =head2 lowestPriority
119
120   accessor: 'lowest_priority'
121   data_type: 'tinyint'
122   default_value: 0
123   is_nullable: 0
124
125 =head2 suspend
126
127   data_type: 'tinyint'
128   default_value: 0
129   is_nullable: 0
130
131 =head2 suspend_until
132
133   data_type: 'datetime'
134   datetime_undef_if_invalid: 1
135   is_nullable: 1
136
137 =head2 itemtype
138
139   data_type: 'varchar'
140   is_foreign_key: 1
141   is_nullable: 1
142   size: 10
143
144 =head2 item_level_hold
145
146   data_type: 'tinyint'
147   default_value: 0
148   is_nullable: 0
149
150 =cut
151
152 __PACKAGE__->add_columns(
153   "reserve_id",
154   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
155   "borrowernumber",
156   {
157     data_type      => "integer",
158     default_value  => 0,
159     is_foreign_key => 1,
160     is_nullable    => 0,
161   },
162   "reservedate",
163   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
164   "biblionumber",
165   {
166     data_type      => "integer",
167     default_value  => 0,
168     is_foreign_key => 1,
169     is_nullable    => 0,
170   },
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",
186   {
187     data_type => "timestamp",
188     datetime_undef_if_invalid => 1,
189     default_value => \"current_timestamp",
190     is_nullable => 0,
191   },
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",
199   {
200     accessor      => "lowest_priority",
201     data_type     => "tinyint",
202     default_value => 0,
203     is_nullable   => 0,
204   },
205   "suspend",
206   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
207   "suspend_until",
208   {
209     data_type => "datetime",
210     datetime_undef_if_invalid => 1,
211     is_nullable => 1,
212   },
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 },
217 );
218
219 =head1 PRIMARY KEY
220
221 =over 4
222
223 =item * L</reserve_id>
224
225 =back
226
227 =cut
228
229 __PACKAGE__->set_primary_key("reserve_id");
230
231 =head1 RELATIONS
232
233 =head2 biblionumber
234
235 Type: belongs_to
236
237 Related object: L<Koha::Schema::Result::Biblio>
238
239 =cut
240
241 __PACKAGE__->belongs_to(
242   "biblionumber",
243   "Koha::Schema::Result::Biblio",
244   { biblionumber => "biblionumber" },
245   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
246 );
247
248 =head2 borrowernumber
249
250 Type: belongs_to
251
252 Related object: L<Koha::Schema::Result::Borrower>
253
254 =cut
255
256 __PACKAGE__->belongs_to(
257   "borrowernumber",
258   "Koha::Schema::Result::Borrower",
259   { borrowernumber => "borrowernumber" },
260   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
261 );
262
263 =head2 branchcode
264
265 Type: belongs_to
266
267 Related object: L<Koha::Schema::Result::Branch>
268
269 =cut
270
271 __PACKAGE__->belongs_to(
272   "branchcode",
273   "Koha::Schema::Result::Branch",
274   { branchcode => "branchcode" },
275   {
276     is_deferrable => 1,
277     join_type     => "LEFT",
278     on_delete     => "CASCADE",
279     on_update     => "CASCADE",
280   },
281 );
282
283 =head2 itemnumber
284
285 Type: belongs_to
286
287 Related object: L<Koha::Schema::Result::Item>
288
289 =cut
290
291 __PACKAGE__->belongs_to(
292   "itemnumber",
293   "Koha::Schema::Result::Item",
294   { itemnumber => "itemnumber" },
295   {
296     is_deferrable => 1,
297     join_type     => "LEFT",
298     on_delete     => "CASCADE",
299     on_update     => "CASCADE",
300   },
301 );
302
303 =head2 itemtype
304
305 Type: belongs_to
306
307 Related object: L<Koha::Schema::Result::Itemtype>
308
309 =cut
310
311 __PACKAGE__->belongs_to(
312   "itemtype",
313   "Koha::Schema::Result::Itemtype",
314   { itemtype => "itemtype" },
315   {
316     is_deferrable => 1,
317     join_type     => "LEFT",
318     on_delete     => "CASCADE",
319     on_update     => "CASCADE",
320   },
321 );
322
323
324 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39
325 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OMFqEWyKqFTcYj7vAFXy/g
326
327 __PACKAGE__->belongs_to(
328   "item",
329   "Koha::Schema::Result::Item",
330   { itemnumber => "itemnumber" },
331   {
332     is_deferrable => 1,
333     join_type     => "LEFT",
334     on_delete     => "CASCADE",
335     on_update     => "CASCADE",
336   },
337 );
338
339 __PACKAGE__->belongs_to(
340   "biblio",
341   "Koha::Schema::Result::Biblio",
342   { biblionumber => "biblionumber" },
343   {
344     is_deferrable => 1,
345     join_type     => "LEFT",
346     on_delete     => "CASCADE",
347     on_update     => "CASCADE",
348   },
349 );
350
351 __PACKAGE__->add_columns(
352     '+lowestPriority' => { is_boolean => 1 },
353     '+suspend' => { is_boolean => 1 }
354 );
355
356 1;