Bug 12558: DBIx::Class schema update 07/2014
[koha.git] / Koha / Schema / Result / Subscription.pm
blob62468a0ecf6a5ac05ead799e2eb72193cfa2d12e
1 use utf8;
2 package Koha::Schema::Result::Subscription;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Subscription
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<subscription>
20 =cut
22 __PACKAGE__->table("subscription");
24 =head1 ACCESSORS
26 =head2 biblionumber
28 data_type: 'integer'
29 default_value: 0
30 is_nullable: 0
32 =head2 subscriptionid
34 data_type: 'integer'
35 is_auto_increment: 1
36 is_nullable: 0
38 =head2 librarian
40 data_type: 'varchar'
41 default_value: (empty string)
42 is_nullable: 1
43 size: 100
45 =head2 startdate
47 data_type: 'date'
48 datetime_undef_if_invalid: 1
49 is_nullable: 1
51 =head2 aqbooksellerid
53 data_type: 'integer'
54 default_value: 0
55 is_nullable: 1
57 =head2 cost
59 data_type: 'integer'
60 default_value: 0
61 is_nullable: 1
63 =head2 aqbudgetid
65 data_type: 'integer'
66 default_value: 0
67 is_nullable: 1
69 =head2 weeklength
71 data_type: 'integer'
72 default_value: 0
73 is_nullable: 1
75 =head2 monthlength
77 data_type: 'integer'
78 default_value: 0
79 is_nullable: 1
81 =head2 numberlength
83 data_type: 'integer'
84 default_value: 0
85 is_nullable: 1
87 =head2 periodicity
89 data_type: 'integer'
90 is_foreign_key: 1
91 is_nullable: 1
93 =head2 countissuesperunit
95 data_type: 'integer'
96 default_value: 1
97 is_nullable: 0
99 =head2 notes
101 data_type: 'mediumtext'
102 is_nullable: 1
104 =head2 status
106 data_type: 'varchar'
107 default_value: (empty string)
108 is_nullable: 0
109 size: 100
111 =head2 lastvalue1
113 data_type: 'integer'
114 is_nullable: 1
116 =head2 innerloop1
118 data_type: 'integer'
119 default_value: 0
120 is_nullable: 1
122 =head2 lastvalue2
124 data_type: 'integer'
125 is_nullable: 1
127 =head2 innerloop2
129 data_type: 'integer'
130 default_value: 0
131 is_nullable: 1
133 =head2 lastvalue3
135 data_type: 'integer'
136 is_nullable: 1
138 =head2 innerloop3
140 data_type: 'integer'
141 default_value: 0
142 is_nullable: 1
144 =head2 firstacquidate
146 data_type: 'date'
147 datetime_undef_if_invalid: 1
148 is_nullable: 1
150 =head2 manualhistory
152 data_type: 'tinyint'
153 default_value: 0
154 is_nullable: 0
156 =head2 irregularity
158 data_type: 'text'
159 is_nullable: 1
161 =head2 skip_serialseq
163 data_type: 'tinyint'
164 default_value: 0
165 is_nullable: 0
167 =head2 letter
169 data_type: 'varchar'
170 is_nullable: 1
171 size: 20
173 =head2 numberpattern
175 data_type: 'integer'
176 is_foreign_key: 1
177 is_nullable: 1
179 =head2 locale
181 data_type: 'varchar'
182 is_nullable: 1
183 size: 80
185 =head2 distributedto
187 data_type: 'text'
188 is_nullable: 1
190 =head2 internalnotes
192 data_type: 'longtext'
193 is_nullable: 1
195 =head2 callnumber
197 data_type: 'text'
198 is_nullable: 1
200 =head2 location
202 data_type: 'varchar'
203 default_value: (empty string)
204 is_nullable: 1
205 size: 80
207 =head2 branchcode
209 data_type: 'varchar'
210 default_value: (empty string)
211 is_nullable: 0
212 size: 10
214 =head2 lastbranch
216 data_type: 'varchar'
217 is_nullable: 1
218 size: 10
220 =head2 serialsadditems
222 data_type: 'tinyint'
223 default_value: 0
224 is_nullable: 0
226 =head2 staffdisplaycount
228 data_type: 'varchar'
229 is_nullable: 1
230 size: 10
232 =head2 opacdisplaycount
234 data_type: 'varchar'
235 is_nullable: 1
236 size: 10
238 =head2 graceperiod
240 data_type: 'integer'
241 default_value: 0
242 is_nullable: 0
244 =head2 enddate
246 data_type: 'date'
247 datetime_undef_if_invalid: 1
248 is_nullable: 1
250 =head2 closed
252 data_type: 'integer'
253 default_value: 0
254 is_nullable: 0
256 =head2 reneweddate
258 data_type: 'date'
259 datetime_undef_if_invalid: 1
260 is_nullable: 1
262 =cut
264 __PACKAGE__->add_columns(
265 "biblionumber",
266 { data_type => "integer", default_value => 0, is_nullable => 0 },
267 "subscriptionid",
268 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
269 "librarian",
270 { data_type => "varchar", default_value => "", is_nullable => 1, size => 100 },
271 "startdate",
272 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
273 "aqbooksellerid",
274 { data_type => "integer", default_value => 0, is_nullable => 1 },
275 "cost",
276 { data_type => "integer", default_value => 0, is_nullable => 1 },
277 "aqbudgetid",
278 { data_type => "integer", default_value => 0, is_nullable => 1 },
279 "weeklength",
280 { data_type => "integer", default_value => 0, is_nullable => 1 },
281 "monthlength",
282 { data_type => "integer", default_value => 0, is_nullable => 1 },
283 "numberlength",
284 { data_type => "integer", default_value => 0, is_nullable => 1 },
285 "periodicity",
286 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
287 "countissuesperunit",
288 { data_type => "integer", default_value => 1, is_nullable => 0 },
289 "notes",
290 { data_type => "mediumtext", is_nullable => 1 },
291 "status",
292 { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 },
293 "lastvalue1",
294 { data_type => "integer", is_nullable => 1 },
295 "innerloop1",
296 { data_type => "integer", default_value => 0, is_nullable => 1 },
297 "lastvalue2",
298 { data_type => "integer", is_nullable => 1 },
299 "innerloop2",
300 { data_type => "integer", default_value => 0, is_nullable => 1 },
301 "lastvalue3",
302 { data_type => "integer", is_nullable => 1 },
303 "innerloop3",
304 { data_type => "integer", default_value => 0, is_nullable => 1 },
305 "firstacquidate",
306 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
307 "manualhistory",
308 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
309 "irregularity",
310 { data_type => "text", is_nullable => 1 },
311 "skip_serialseq",
312 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
313 "letter",
314 { data_type => "varchar", is_nullable => 1, size => 20 },
315 "numberpattern",
316 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
317 "locale",
318 { data_type => "varchar", is_nullable => 1, size => 80 },
319 "distributedto",
320 { data_type => "text", is_nullable => 1 },
321 "internalnotes",
322 { data_type => "longtext", is_nullable => 1 },
323 "callnumber",
324 { data_type => "text", is_nullable => 1 },
325 "location",
326 { data_type => "varchar", default_value => "", is_nullable => 1, size => 80 },
327 "branchcode",
328 { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
329 "lastbranch",
330 { data_type => "varchar", is_nullable => 1, size => 10 },
331 "serialsadditems",
332 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
333 "staffdisplaycount",
334 { data_type => "varchar", is_nullable => 1, size => 10 },
335 "opacdisplaycount",
336 { data_type => "varchar", is_nullable => 1, size => 10 },
337 "graceperiod",
338 { data_type => "integer", default_value => 0, is_nullable => 0 },
339 "enddate",
340 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
341 "closed",
342 { data_type => "integer", default_value => 0, is_nullable => 0 },
343 "reneweddate",
344 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
347 =head1 PRIMARY KEY
349 =over 4
351 =item * L</subscriptionid>
353 =back
355 =cut
357 __PACKAGE__->set_primary_key("subscriptionid");
359 =head1 RELATIONS
361 =head2 aqorders
363 Type: has_many
365 Related object: L<Koha::Schema::Result::Aqorder>
367 =cut
369 __PACKAGE__->has_many(
370 "aqorders",
371 "Koha::Schema::Result::Aqorder",
372 { "foreign.subscriptionid" => "self.subscriptionid" },
373 { cascade_copy => 0, cascade_delete => 0 },
376 =head2 numberpattern
378 Type: belongs_to
380 Related object: L<Koha::Schema::Result::SubscriptionNumberpattern>
382 =cut
384 __PACKAGE__->belongs_to(
385 "numberpattern",
386 "Koha::Schema::Result::SubscriptionNumberpattern",
387 { id => "numberpattern" },
389 is_deferrable => 1,
390 join_type => "LEFT",
391 on_delete => "SET NULL",
392 on_update => "CASCADE",
396 =head2 periodicity
398 Type: belongs_to
400 Related object: L<Koha::Schema::Result::SubscriptionFrequency>
402 =cut
404 __PACKAGE__->belongs_to(
405 "periodicity",
406 "Koha::Schema::Result::SubscriptionFrequency",
407 { id => "periodicity" },
409 is_deferrable => 1,
410 join_type => "LEFT",
411 on_delete => "SET NULL",
412 on_update => "CASCADE",
416 =head2 subscriptionroutinglists
418 Type: has_many
420 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
422 =cut
424 __PACKAGE__->has_many(
425 "subscriptionroutinglists",
426 "Koha::Schema::Result::Subscriptionroutinglist",
427 { "foreign.subscriptionid" => "self.subscriptionid" },
428 { cascade_copy => 0, cascade_delete => 0 },
432 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
433 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57kc1/B3eNKQXAk9tlOy0A
436 # You can replace this text with custom content, and it will be preserved on regeneration