Bug 11703 - Convert checkouts table to ajax datatable
[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 constrainttype
53
54   data_type: 'varchar'
55   is_nullable: 1
56   size: 1
57
58 =head2 branchcode
59
60   data_type: 'varchar'
61   is_foreign_key: 1
62   is_nullable: 1
63   size: 10
64
65 =head2 notificationdate
66
67   data_type: 'date'
68   datetime_undef_if_invalid: 1
69   is_nullable: 1
70
71 =head2 reminderdate
72
73   data_type: 'date'
74   datetime_undef_if_invalid: 1
75   is_nullable: 1
76
77 =head2 cancellationdate
78
79   data_type: 'date'
80   datetime_undef_if_invalid: 1
81   is_nullable: 1
82
83 =head2 reservenotes
84
85   data_type: 'mediumtext'
86   is_nullable: 1
87
88 =head2 priority
89
90   data_type: 'smallint'
91   is_nullable: 1
92
93 =head2 found
94
95   data_type: 'varchar'
96   is_nullable: 1
97   size: 1
98
99 =head2 timestamp
100
101   data_type: 'timestamp'
102   datetime_undef_if_invalid: 1
103   default_value: current_timestamp
104   is_nullable: 0
105
106 =head2 itemnumber
107
108   data_type: 'integer'
109   is_foreign_key: 1
110   is_nullable: 1
111
112 =head2 waitingdate
113
114   data_type: 'date'
115   datetime_undef_if_invalid: 1
116   is_nullable: 1
117
118 =head2 expirationdate
119
120   data_type: 'date'
121   datetime_undef_if_invalid: 1
122   is_nullable: 1
123
124 =head2 lowestpriority
125
126   data_type: 'tinyint'
127   is_nullable: 0
128
129 =head2 suspend
130
131   data_type: 'tinyint'
132   default_value: 0
133   is_nullable: 0
134
135 =head2 suspend_until
136
137   data_type: 'datetime'
138   datetime_undef_if_invalid: 1
139   is_nullable: 1
140
141 =cut
142
143 __PACKAGE__->add_columns(
144   "reserve_id",
145   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
146   "borrowernumber",
147   {
148     data_type      => "integer",
149     default_value  => 0,
150     is_foreign_key => 1,
151     is_nullable    => 0,
152   },
153   "reservedate",
154   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
155   "biblionumber",
156   {
157     data_type      => "integer",
158     default_value  => 0,
159     is_foreign_key => 1,
160     is_nullable    => 0,
161   },
162   "constrainttype",
163   { data_type => "varchar", is_nullable => 1, size => 1 },
164   "branchcode",
165   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
166   "notificationdate",
167   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
168   "reminderdate",
169   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
170   "cancellationdate",
171   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
172   "reservenotes",
173   { data_type => "mediumtext", is_nullable => 1 },
174   "priority",
175   { data_type => "smallint", is_nullable => 1 },
176   "found",
177   { data_type => "varchar", is_nullable => 1, size => 1 },
178   "timestamp",
179   {
180     data_type => "timestamp",
181     datetime_undef_if_invalid => 1,
182     default_value => \"current_timestamp",
183     is_nullable => 0,
184   },
185   "itemnumber",
186   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
187   "waitingdate",
188   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
189   "expirationdate",
190   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
191   "lowestpriority",
192   { data_type => "tinyint", is_nullable => 0 },
193   "suspend",
194   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
195   "suspend_until",
196   {
197     data_type => "datetime",
198     datetime_undef_if_invalid => 1,
199     is_nullable => 1,
200   },
201 );
202
203 =head1 PRIMARY KEY
204
205 =over 4
206
207 =item * L</reserve_id>
208
209 =back
210
211 =cut
212
213 __PACKAGE__->set_primary_key("reserve_id");
214
215 =head1 RELATIONS
216
217 =head2 biblionumber
218
219 Type: belongs_to
220
221 Related object: L<Koha::Schema::Result::Biblio>
222
223 =cut
224
225 __PACKAGE__->belongs_to(
226   "biblionumber",
227   "Koha::Schema::Result::Biblio",
228   { biblionumber => "biblionumber" },
229   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
230 );
231
232 =head2 borrowernumber
233
234 Type: belongs_to
235
236 Related object: L<Koha::Schema::Result::Borrower>
237
238 =cut
239
240 __PACKAGE__->belongs_to(
241   "borrowernumber",
242   "Koha::Schema::Result::Borrower",
243   { borrowernumber => "borrowernumber" },
244   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
245 );
246
247 =head2 branchcode
248
249 Type: belongs_to
250
251 Related object: L<Koha::Schema::Result::Branch>
252
253 =cut
254
255 __PACKAGE__->belongs_to(
256   "branchcode",
257   "Koha::Schema::Result::Branch",
258   { branchcode => "branchcode" },
259   {
260     is_deferrable => 1,
261     join_type     => "LEFT",
262     on_delete     => "CASCADE",
263     on_update     => "CASCADE",
264   },
265 );
266
267 =head2 itemnumber
268
269 Type: belongs_to
270
271 Related object: L<Koha::Schema::Result::Item>
272
273 =cut
274
275 __PACKAGE__->belongs_to(
276   "itemnumber",
277   "Koha::Schema::Result::Item",
278   { itemnumber => "itemnumber" },
279   {
280     is_deferrable => 1,
281     join_type     => "LEFT",
282     on_delete     => "CASCADE",
283     on_update     => "CASCADE",
284   },
285 );
286
287
288 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
289 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ig/fobzvZf1OgAHZFtkyyQ
290
291 __PACKAGE__->belongs_to(
292   "item",
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 __PACKAGE__->belongs_to(
304   "biblio",
305   "Koha::Schema::Result::Biblio",
306   { biblionumber => "biblionumber" },
307   {
308     is_deferrable => 1,
309     join_type     => "LEFT",
310     on_delete     => "CASCADE",
311     on_update     => "CASCADE",
312   },
313 );
314
315 1;