Bug 34029: DBIC schema
[koha.git] / Koha / Schema / Result / Biblioitem.pm
1 use utf8;
2 package Koha::Schema::Result::Biblioitem;
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::Biblioitem
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<biblioitems>
19
20 =cut
21
22 __PACKAGE__->table("biblioitems");
23
24 =head1 ACCESSORS
25
26 =head2 biblioitemnumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 primary key, unique identifier assigned by Koha
33
34 =head2 biblionumber
35
36   data_type: 'integer'
37   default_value: 0
38   is_foreign_key: 1
39   is_nullable: 0
40
41 foreign key linking this table to the biblio table
42
43 =head2 volume
44
45   data_type: 'longtext'
46   is_nullable: 1
47
48 =head2 number
49
50   data_type: 'longtext'
51   is_nullable: 1
52
53 =head2 itemtype
54
55   data_type: 'varchar'
56   is_nullable: 1
57   size: 10
58
59 biblio level item type (MARC21 942$c)
60
61 =head2 isbn
62
63   data_type: 'longtext'
64   is_nullable: 1
65
66 ISBN (MARC21 020$a)
67
68 =head2 issn
69
70   data_type: 'longtext'
71   is_nullable: 1
72
73 ISSN (MARC21 022$a)
74
75 =head2 ean
76
77   data_type: 'longtext'
78   is_nullable: 1
79
80 =head2 publicationyear
81
82   data_type: 'mediumtext'
83   is_nullable: 1
84
85 =head2 publishercode
86
87   data_type: 'text'
88   is_nullable: 1
89
90 publisher (MARC21 260$b and 246$b)
91
92 =head2 volumedate
93
94   data_type: 'date'
95   datetime_undef_if_invalid: 1
96   is_nullable: 1
97
98 =head2 volumedesc
99
100   data_type: 'mediumtext'
101   is_nullable: 1
102
103 volume information (MARC21 362$a)
104
105 =head2 collectiontitle
106
107   data_type: 'longtext'
108   is_nullable: 1
109
110 =head2 collectionissn
111
112   data_type: 'mediumtext'
113   is_nullable: 1
114
115 =head2 collectionvolume
116
117   data_type: 'longtext'
118   is_nullable: 1
119
120 =head2 editionstatement
121
122   data_type: 'mediumtext'
123   is_nullable: 1
124
125 =head2 editionresponsibility
126
127   data_type: 'mediumtext'
128   is_nullable: 1
129
130 =head2 timestamp
131
132   data_type: 'timestamp'
133   datetime_undef_if_invalid: 1
134   default_value: current_timestamp
135   is_nullable: 0
136
137 =head2 illus
138
139   data_type: 'text'
140   is_nullable: 1
141
142 illustrations (MARC21 300$b)
143
144 =head2 pages
145
146   data_type: 'text'
147   is_nullable: 1
148
149 number of pages (MARC21 300$a)
150
151 =head2 notes
152
153   data_type: 'longtext'
154   is_nullable: 1
155
156 =head2 size
157
158   data_type: 'text'
159   is_nullable: 1
160
161 material size (MARC21 300$c)
162
163 =head2 place
164
165   data_type: 'text'
166   is_nullable: 1
167
168 publication place (MARC21 260$a and 264$a)
169
170 =head2 lccn
171
172   data_type: 'longtext'
173   is_nullable: 1
174
175 library of congress control number (MARC21 010$a)
176
177 =head2 url
178
179   data_type: 'mediumtext'
180   is_nullable: 1
181
182 url (MARC21 856$u)
183
184 =head2 cn_source
185
186   data_type: 'varchar'
187   is_nullable: 1
188   size: 10
189
190 classification source (MARC21 942$2)
191
192 =head2 cn_class
193
194   data_type: 'varchar'
195   is_nullable: 1
196   size: 30
197
198 =head2 cn_item
199
200   data_type: 'varchar'
201   is_nullable: 1
202   size: 10
203
204 =head2 cn_suffix
205
206   data_type: 'varchar'
207   is_nullable: 1
208   size: 10
209
210 =head2 cn_sort
211
212   data_type: 'varchar'
213   is_nullable: 1
214   size: 255
215
216 normalized version of the call number used for sorting
217
218 =head2 agerestriction
219
220   data_type: 'varchar'
221   is_nullable: 1
222   size: 255
223
224 target audience/age restriction from the bib record (MARC21 521$a)
225
226 =head2 totalissues
227
228   data_type: 'integer'
229   is_nullable: 1
230
231 =cut
232
233 __PACKAGE__->add_columns(
234   "biblioitemnumber",
235   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
236   "biblionumber",
237   {
238     data_type      => "integer",
239     default_value  => 0,
240     is_foreign_key => 1,
241     is_nullable    => 0,
242   },
243   "volume",
244   { data_type => "longtext", is_nullable => 1 },
245   "number",
246   { data_type => "longtext", is_nullable => 1 },
247   "itemtype",
248   { data_type => "varchar", is_nullable => 1, size => 10 },
249   "isbn",
250   { data_type => "longtext", is_nullable => 1 },
251   "issn",
252   { data_type => "longtext", is_nullable => 1 },
253   "ean",
254   { data_type => "longtext", is_nullable => 1 },
255   "publicationyear",
256   { data_type => "mediumtext", is_nullable => 1 },
257   "publishercode",
258   { data_type => "text", is_nullable => 1 },
259   "volumedate",
260   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
261   "volumedesc",
262   { data_type => "mediumtext", is_nullable => 1 },
263   "collectiontitle",
264   { data_type => "longtext", is_nullable => 1 },
265   "collectionissn",
266   { data_type => "mediumtext", is_nullable => 1 },
267   "collectionvolume",
268   { data_type => "longtext", is_nullable => 1 },
269   "editionstatement",
270   { data_type => "mediumtext", is_nullable => 1 },
271   "editionresponsibility",
272   { data_type => "mediumtext", is_nullable => 1 },
273   "timestamp",
274   {
275     data_type => "timestamp",
276     datetime_undef_if_invalid => 1,
277     default_value => \"current_timestamp",
278     is_nullable => 0,
279   },
280   "illus",
281   { data_type => "text", is_nullable => 1 },
282   "pages",
283   { data_type => "text", is_nullable => 1 },
284   "notes",
285   { data_type => "longtext", is_nullable => 1 },
286   "size",
287   { data_type => "text", is_nullable => 1 },
288   "place",
289   { data_type => "text", is_nullable => 1 },
290   "lccn",
291   { data_type => "longtext", is_nullable => 1 },
292   "url",
293   { data_type => "mediumtext", is_nullable => 1 },
294   "cn_source",
295   { data_type => "varchar", is_nullable => 1, size => 10 },
296   "cn_class",
297   { data_type => "varchar", is_nullable => 1, size => 30 },
298   "cn_item",
299   { data_type => "varchar", is_nullable => 1, size => 10 },
300   "cn_suffix",
301   { data_type => "varchar", is_nullable => 1, size => 10 },
302   "cn_sort",
303   { data_type => "varchar", is_nullable => 1, size => 255 },
304   "agerestriction",
305   { data_type => "varchar", is_nullable => 1, size => 255 },
306   "totalissues",
307   { data_type => "integer", is_nullable => 1 },
308 );
309
310 =head1 PRIMARY KEY
311
312 =over 4
313
314 =item * L</biblioitemnumber>
315
316 =back
317
318 =cut
319
320 __PACKAGE__->set_primary_key("biblioitemnumber");
321
322 =head1 RELATIONS
323
324 =head2 biblionumber
325
326 Type: belongs_to
327
328 Related object: L<Koha::Schema::Result::Biblio>
329
330 =cut
331
332 __PACKAGE__->belongs_to(
333   "biblionumber",
334   "Koha::Schema::Result::Biblio",
335   { biblionumber => "biblionumber" },
336   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
337 );
338
339 =head2 items
340
341 Type: has_many
342
343 Related object: L<Koha::Schema::Result::Item>
344
345 =cut
346
347 __PACKAGE__->has_many(
348   "items",
349   "Koha::Schema::Result::Item",
350   { "foreign.biblioitemnumber" => "self.biblioitemnumber" },
351   { cascade_copy => 0, cascade_delete => 0 },
352 );
353
354
355 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-26 12:47:08
356 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6a9kLpJoQrsMu+CIx7KMBg
357
358 __PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" );
359
360 1;