Bug 11577: Update DBIx
[koha.git] / Koha / Schema / Result / Issue.pm
1 use utf8;
2 package Koha::Schema::Result::Issue;
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::Issue
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<issues>
19
20 =cut
21
22 __PACKAGE__->table("issues");
23
24 =head1 ACCESSORS
25
26 =head2 borrowernumber
27
28   data_type: 'integer'
29   is_foreign_key: 1
30   is_nullable: 1
31
32 =head2 itemnumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 date_due
39
40   data_type: 'datetime'
41   datetime_undef_if_invalid: 1
42   is_nullable: 1
43
44 =head2 branchcode
45
46   data_type: 'varchar'
47   is_nullable: 1
48   size: 10
49
50 =head2 issuingbranch
51
52   data_type: 'varchar'
53   is_nullable: 1
54   size: 18
55
56 =head2 returndate
57
58   data_type: 'datetime'
59   datetime_undef_if_invalid: 1
60   is_nullable: 1
61
62 =head2 lastreneweddate
63
64   data_type: 'datetime'
65   datetime_undef_if_invalid: 1
66   is_nullable: 1
67
68 =head2 return
69
70   data_type: 'varchar'
71   is_nullable: 1
72   size: 4
73
74 =head2 renewals
75
76   data_type: 'tinyint'
77   is_nullable: 1
78
79 =head2 auto_renew
80
81   data_type: 'tinyint'
82   default_value: 0
83   is_nullable: 1
84
85 =head2 timestamp
86
87   data_type: 'timestamp'
88   datetime_undef_if_invalid: 1
89   default_value: current_timestamp
90   is_nullable: 0
91
92 =head2 issuedate
93
94   data_type: 'datetime'
95   datetime_undef_if_invalid: 1
96   is_nullable: 1
97
98 =cut
99
100 __PACKAGE__->add_columns(
101   "borrowernumber",
102   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
103   "itemnumber",
104   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
105   "date_due",
106   {
107     data_type => "datetime",
108     datetime_undef_if_invalid => 1,
109     is_nullable => 1,
110   },
111   "branchcode",
112   { data_type => "varchar", is_nullable => 1, size => 10 },
113   "issuingbranch",
114   { data_type => "varchar", is_nullable => 1, size => 18 },
115   "returndate",
116   {
117     data_type => "datetime",
118     datetime_undef_if_invalid => 1,
119     is_nullable => 1,
120   },
121   "lastreneweddate",
122   {
123     data_type => "datetime",
124     datetime_undef_if_invalid => 1,
125     is_nullable => 1,
126   },
127   "return",
128   { data_type => "varchar", is_nullable => 1, size => 4 },
129   "renewals",
130   { data_type => "tinyint", is_nullable => 1 },
131   "auto_renew",
132   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
133   "timestamp",
134   {
135     data_type => "timestamp",
136     datetime_undef_if_invalid => 1,
137     default_value => \"current_timestamp",
138     is_nullable => 0,
139   },
140   "issuedate",
141   {
142     data_type => "datetime",
143     datetime_undef_if_invalid => 1,
144     is_nullable => 1,
145   },
146 );
147
148 =head1 RELATIONS
149
150 =head2 borrowernumber
151
152 Type: belongs_to
153
154 Related object: L<Koha::Schema::Result::Borrower>
155
156 =cut
157
158 __PACKAGE__->belongs_to(
159   "borrowernumber",
160   "Koha::Schema::Result::Borrower",
161   { borrowernumber => "borrowernumber" },
162   {
163     is_deferrable => 1,
164     join_type     => "LEFT",
165     on_delete     => "RESTRICT",
166     on_update     => "CASCADE",
167   },
168 );
169
170 =head2 itemnumber
171
172 Type: belongs_to
173
174 Related object: L<Koha::Schema::Result::Item>
175
176 =cut
177
178 __PACKAGE__->belongs_to(
179   "itemnumber",
180   "Koha::Schema::Result::Item",
181   { itemnumber => "itemnumber" },
182   {
183     is_deferrable => 1,
184     join_type     => "LEFT",
185     on_delete     => "RESTRICT",
186     on_update     => "CASCADE",
187   },
188 );
189
190
191 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-09-17 21:06:58
192 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vhnsyH2GOjEEjOWjCS5Lpw
193
194 __PACKAGE__->belongs_to(
195     "borrower",
196     "Koha::Schema::Result::Borrower",
197     { borrowernumber => "borrowernumber" },
198     { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
199 );
200
201 __PACKAGE__->belongs_to(
202   "item",
203   "Koha::Schema::Result::Item",
204   { itemnumber => "itemnumber" },
205   {
206     is_deferrable => 1,
207     join_type     => "LEFT",
208     on_delete     => "CASCADE",
209     on_update     => "CASCADE",
210   },
211 );
212
213 __PACKAGE__->belongs_to(
214   "branch",
215   "Koha::Schema::Result::Branch",
216   { branchcode => "branchcode" },
217   {
218     is_deferrable => 1,
219     join_type     => "LEFT",
220     on_delete     => "CASCADE",
221     on_update     => "CASCADE",
222   },
223 );
224
225 1;