Bug 22125: branches.pickup_location should be flagged as boolean
[koha.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 =cut
145
146 __PACKAGE__->add_columns(
147   "reserve_id",
148   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
149   "borrowernumber",
150   {
151     data_type      => "integer",
152     default_value  => 0,
153     is_foreign_key => 1,
154     is_nullable    => 0,
155   },
156   "reservedate",
157   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
158   "biblionumber",
159   {
160     data_type      => "integer",
161     default_value  => 0,
162     is_foreign_key => 1,
163     is_nullable    => 0,
164   },
165   "branchcode",
166   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
167   "notificationdate",
168   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
169   "reminderdate",
170   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
171   "cancellationdate",
172   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
173   "reservenotes",
174   { data_type => "longtext", is_nullable => 1 },
175   "priority",
176   { data_type => "smallint", is_nullable => 1 },
177   "found",
178   { data_type => "varchar", is_nullable => 1, size => 1 },
179   "timestamp",
180   {
181     data_type => "timestamp",
182     datetime_undef_if_invalid => 1,
183     default_value => \"current_timestamp",
184     is_nullable => 0,
185   },
186   "itemnumber",
187   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
188   "waitingdate",
189   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
190   "expirationdate",
191   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
192   "lowestPriority",
193   {
194     accessor      => "lowest_priority",
195     data_type     => "tinyint",
196     default_value => 0,
197     is_nullable   => 0,
198   },
199   "suspend",
200   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
201   "suspend_until",
202   {
203     data_type => "datetime",
204     datetime_undef_if_invalid => 1,
205     is_nullable => 1,
206   },
207   "itemtype",
208   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
209 );
210
211 =head1 PRIMARY KEY
212
213 =over 4
214
215 =item * L</reserve_id>
216
217 =back
218
219 =cut
220
221 __PACKAGE__->set_primary_key("reserve_id");
222
223 =head1 RELATIONS
224
225 =head2 biblionumber
226
227 Type: belongs_to
228
229 Related object: L<Koha::Schema::Result::Biblio>
230
231 =cut
232
233 __PACKAGE__->belongs_to(
234   "biblionumber",
235   "Koha::Schema::Result::Biblio",
236   { biblionumber => "biblionumber" },
237   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
238 );
239
240 =head2 borrowernumber
241
242 Type: belongs_to
243
244 Related object: L<Koha::Schema::Result::Borrower>
245
246 =cut
247
248 __PACKAGE__->belongs_to(
249   "borrowernumber",
250   "Koha::Schema::Result::Borrower",
251   { borrowernumber => "borrowernumber" },
252   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
253 );
254
255 =head2 branchcode
256
257 Type: belongs_to
258
259 Related object: L<Koha::Schema::Result::Branch>
260
261 =cut
262
263 __PACKAGE__->belongs_to(
264   "branchcode",
265   "Koha::Schema::Result::Branch",
266   { branchcode => "branchcode" },
267   {
268     is_deferrable => 1,
269     join_type     => "LEFT",
270     on_delete     => "CASCADE",
271     on_update     => "CASCADE",
272   },
273 );
274
275 =head2 itemnumber
276
277 Type: belongs_to
278
279 Related object: L<Koha::Schema::Result::Item>
280
281 =cut
282
283 __PACKAGE__->belongs_to(
284   "itemnumber",
285   "Koha::Schema::Result::Item",
286   { itemnumber => "itemnumber" },
287   {
288     is_deferrable => 1,
289     join_type     => "LEFT",
290     on_delete     => "CASCADE",
291     on_update     => "CASCADE",
292   },
293 );
294
295 =head2 itemtype
296
297 Type: belongs_to
298
299 Related object: L<Koha::Schema::Result::Itemtype>
300
301 =cut
302
303 __PACKAGE__->belongs_to(
304   "itemtype",
305   "Koha::Schema::Result::Itemtype",
306   { itemtype => "itemtype" },
307   {
308     is_deferrable => 1,
309     join_type     => "LEFT",
310     on_delete     => "CASCADE",
311     on_update     => "CASCADE",
312   },
313 );
314
315
316 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
317 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2GCET9quFpUvzuN7MUWZNw
318
319 __PACKAGE__->belongs_to(
320   "item",
321   "Koha::Schema::Result::Item",
322   { itemnumber => "itemnumber" },
323   {
324     is_deferrable => 1,
325     join_type     => "LEFT",
326     on_delete     => "CASCADE",
327     on_update     => "CASCADE",
328   },
329 );
330
331 __PACKAGE__->belongs_to(
332   "biblio",
333   "Koha::Schema::Result::Biblio",
334   { biblionumber => "biblionumber" },
335   {
336     is_deferrable => 1,
337     join_type     => "LEFT",
338     on_delete     => "CASCADE",
339     on_update     => "CASCADE",
340   },
341 );
342
343 __PACKAGE__->add_columns(
344     '+lowestPriority' => { is_boolean => 1 },
345     '+suspend' => { is_boolean => 1 }
346 );
347
348 1;