Bug 14237: Schema updates
[koha.git] / Koha / Schema / Result / Biblio.pm
1 use utf8;
2 package Koha::Schema::Result::Biblio;
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::Biblio
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<biblio>
19
20 =cut
21
22 __PACKAGE__->table("biblio");
23
24 =head1 ACCESSORS
25
26 =head2 biblionumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique identifier assigned to each bibliographic record
33
34 =head2 frameworkcode
35
36   data_type: 'varchar'
37   default_value: (empty string)
38   is_nullable: 0
39   size: 4
40
41 foreign key from the biblio_framework table to identify which framework was used in cataloging this record
42
43 =head2 author
44
45   data_type: 'longtext'
46   is_nullable: 1
47
48 statement of responsibility from MARC record (100$a in MARC21)
49
50 =head2 title
51
52   data_type: 'longtext'
53   is_nullable: 1
54
55 title (without the subtitle) from the MARC record (245$a in MARC21)
56
57 =head2 medium
58
59   data_type: 'longtext'
60   is_nullable: 1
61
62 medium from the MARC record (245$h in MARC21)
63
64 =head2 subtitle
65
66   data_type: 'longtext'
67   is_nullable: 1
68
69 remainder of the title from the MARC record (245$b in MARC21)
70
71 =head2 part_number
72
73   data_type: 'longtext'
74   is_nullable: 1
75
76 part number from the MARC record (245$n in MARC21)
77
78 =head2 part_name
79
80   data_type: 'longtext'
81   is_nullable: 1
82
83 part name from the MARC record (245$p in MARC21)
84
85 =head2 unititle
86
87   data_type: 'longtext'
88   is_nullable: 1
89
90 uniform title (without the subtitle) from the MARC record (240$a in MARC21)
91
92 =head2 notes
93
94   data_type: 'longtext'
95   is_nullable: 1
96
97 values from the general notes field in the MARC record (500$a in MARC21) split by bar (|)
98
99 =head2 serial
100
101   data_type: 'tinyint'
102   is_nullable: 1
103
104 Boolean indicating whether biblio is for a serial
105
106 =head2 seriestitle
107
108   data_type: 'longtext'
109   is_nullable: 1
110
111 =head2 copyrightdate
112
113   data_type: 'smallint'
114   is_nullable: 1
115
116 publication or copyright date from the MARC record
117
118 =head2 timestamp
119
120   data_type: 'timestamp'
121   datetime_undef_if_invalid: 1
122   default_value: current_timestamp
123   is_nullable: 0
124
125 date and time this record was last touched
126
127 =head2 datecreated
128
129   data_type: 'date'
130   datetime_undef_if_invalid: 1
131   is_nullable: 0
132
133 the date this record was added to Koha
134
135 =head2 abstract
136
137   data_type: 'longtext'
138   is_nullable: 1
139
140 summary from the MARC record (520$a in MARC21)
141
142 =cut
143
144 __PACKAGE__->add_columns(
145   "biblionumber",
146   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
147   "frameworkcode",
148   { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
149   "author",
150   { data_type => "longtext", is_nullable => 1 },
151   "title",
152   { data_type => "longtext", is_nullable => 1 },
153   "medium",
154   { data_type => "longtext", is_nullable => 1 },
155   "subtitle",
156   { data_type => "longtext", is_nullable => 1 },
157   "part_number",
158   { data_type => "longtext", is_nullable => 1 },
159   "part_name",
160   { data_type => "longtext", is_nullable => 1 },
161   "unititle",
162   { data_type => "longtext", is_nullable => 1 },
163   "notes",
164   { data_type => "longtext", is_nullable => 1 },
165   "serial",
166   { data_type => "tinyint", is_nullable => 1 },
167   "seriestitle",
168   { data_type => "longtext", is_nullable => 1 },
169   "copyrightdate",
170   { data_type => "smallint", is_nullable => 1 },
171   "timestamp",
172   {
173     data_type => "timestamp",
174     datetime_undef_if_invalid => 1,
175     default_value => \"current_timestamp",
176     is_nullable => 0,
177   },
178   "datecreated",
179   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
180   "abstract",
181   { data_type => "longtext", is_nullable => 1 },
182 );
183
184 =head1 PRIMARY KEY
185
186 =over 4
187
188 =item * L</biblionumber>
189
190 =back
191
192 =cut
193
194 __PACKAGE__->set_primary_key("biblionumber");
195
196 =head1 RELATIONS
197
198 =head2 aqorders
199
200 Type: has_many
201
202 Related object: L<Koha::Schema::Result::Aqorder>
203
204 =cut
205
206 __PACKAGE__->has_many(
207   "aqorders",
208   "Koha::Schema::Result::Aqorder",
209   { "foreign.biblionumber" => "self.biblionumber" },
210   { cascade_copy => 0, cascade_delete => 0 },
211 );
212
213 =head2 article_requests
214
215 Type: has_many
216
217 Related object: L<Koha::Schema::Result::ArticleRequest>
218
219 =cut
220
221 __PACKAGE__->has_many(
222   "article_requests",
223   "Koha::Schema::Result::ArticleRequest",
224   { "foreign.biblionumber" => "self.biblionumber" },
225   { cascade_copy => 0, cascade_delete => 0 },
226 );
227
228 =head2 biblio_metadatas
229
230 Type: has_many
231
232 Related object: L<Koha::Schema::Result::BiblioMetadata>
233
234 =cut
235
236 __PACKAGE__->has_many(
237   "biblio_metadatas",
238   "Koha::Schema::Result::BiblioMetadata",
239   { "foreign.biblionumber" => "self.biblionumber" },
240   { cascade_copy => 0, cascade_delete => 0 },
241 );
242
243 =head2 biblioitems
244
245 Type: has_many
246
247 Related object: L<Koha::Schema::Result::Biblioitem>
248
249 =cut
250
251 __PACKAGE__->has_many(
252   "biblioitems",
253   "Koha::Schema::Result::Biblioitem",
254   { "foreign.biblionumber" => "self.biblionumber" },
255   { cascade_copy => 0, cascade_delete => 0 },
256 );
257
258 =head2 club_holds
259
260 Type: has_many
261
262 Related object: L<Koha::Schema::Result::ClubHold>
263
264 =cut
265
266 __PACKAGE__->has_many(
267   "club_holds",
268   "Koha::Schema::Result::ClubHold",
269   { "foreign.biblio_id" => "self.biblionumber" },
270   { cascade_copy => 0, cascade_delete => 0 },
271 );
272
273 =head2 course_items
274
275 Type: has_many
276
277 Related object: L<Koha::Schema::Result::CourseItem>
278
279 =cut
280
281 __PACKAGE__->has_many(
282   "course_items",
283   "Koha::Schema::Result::CourseItem",
284   { "foreign.biblionumber" => "self.biblionumber" },
285   { cascade_copy => 0, cascade_delete => 0 },
286 );
287
288 =head2 cover_images
289
290 Type: has_many
291
292 Related object: L<Koha::Schema::Result::CoverImage>
293
294 =cut
295
296 __PACKAGE__->has_many(
297   "cover_images",
298   "Koha::Schema::Result::CoverImage",
299   { "foreign.biblionumber" => "self.biblionumber" },
300   { cascade_copy => 0, cascade_delete => 0 },
301 );
302
303 =head2 hold_fill_targets
304
305 Type: has_many
306
307 Related object: L<Koha::Schema::Result::HoldFillTarget>
308
309 =cut
310
311 __PACKAGE__->has_many(
312   "hold_fill_targets",
313   "Koha::Schema::Result::HoldFillTarget",
314   { "foreign.biblionumber" => "self.biblionumber" },
315   { cascade_copy => 0, cascade_delete => 0 },
316 );
317
318 =head2 items
319
320 Type: has_many
321
322 Related object: L<Koha::Schema::Result::Item>
323
324 =cut
325
326 __PACKAGE__->has_many(
327   "items",
328   "Koha::Schema::Result::Item",
329   { "foreign.biblionumber" => "self.biblionumber" },
330   { cascade_copy => 0, cascade_delete => 0 },
331 );
332
333 =head2 old_reserves
334
335 Type: has_many
336
337 Related object: L<Koha::Schema::Result::OldReserve>
338
339 =cut
340
341 __PACKAGE__->has_many(
342   "old_reserves",
343   "Koha::Schema::Result::OldReserve",
344   { "foreign.biblionumber" => "self.biblionumber" },
345   { cascade_copy => 0, cascade_delete => 0 },
346 );
347
348 =head2 ratings
349
350 Type: has_many
351
352 Related object: L<Koha::Schema::Result::Rating>
353
354 =cut
355
356 __PACKAGE__->has_many(
357   "ratings",
358   "Koha::Schema::Result::Rating",
359   { "foreign.biblionumber" => "self.biblionumber" },
360   { cascade_copy => 0, cascade_delete => 0 },
361 );
362
363 =head2 reserves
364
365 Type: has_many
366
367 Related object: L<Koha::Schema::Result::Reserve>
368
369 =cut
370
371 __PACKAGE__->has_many(
372   "reserves",
373   "Koha::Schema::Result::Reserve",
374   { "foreign.biblionumber" => "self.biblionumber" },
375   { cascade_copy => 0, cascade_delete => 0 },
376 );
377
378 =head2 reviews
379
380 Type: has_many
381
382 Related object: L<Koha::Schema::Result::Review>
383
384 =cut
385
386 __PACKAGE__->has_many(
387   "reviews",
388   "Koha::Schema::Result::Review",
389   { "foreign.biblionumber" => "self.biblionumber" },
390   { cascade_copy => 0, cascade_delete => 0 },
391 );
392
393 =head2 serials
394
395 Type: has_many
396
397 Related object: L<Koha::Schema::Result::Serial>
398
399 =cut
400
401 __PACKAGE__->has_many(
402   "serials",
403   "Koha::Schema::Result::Serial",
404   { "foreign.biblionumber" => "self.biblionumber" },
405   { cascade_copy => 0, cascade_delete => 0 },
406 );
407
408 =head2 subscriptionhistories
409
410 Type: has_many
411
412 Related object: L<Koha::Schema::Result::Subscriptionhistory>
413
414 =cut
415
416 __PACKAGE__->has_many(
417   "subscriptionhistories",
418   "Koha::Schema::Result::Subscriptionhistory",
419   { "foreign.biblionumber" => "self.biblionumber" },
420   { cascade_copy => 0, cascade_delete => 0 },
421 );
422
423 =head2 subscriptions
424
425 Type: has_many
426
427 Related object: L<Koha::Schema::Result::Subscription>
428
429 =cut
430
431 __PACKAGE__->has_many(
432   "subscriptions",
433   "Koha::Schema::Result::Subscription",
434   { "foreign.biblionumber" => "self.biblionumber" },
435   { cascade_copy => 0, cascade_delete => 0 },
436 );
437
438 =head2 suggestions
439
440 Type: has_many
441
442 Related object: L<Koha::Schema::Result::Suggestion>
443
444 =cut
445
446 __PACKAGE__->has_many(
447   "suggestions",
448   "Koha::Schema::Result::Suggestion",
449   { "foreign.biblionumber" => "self.biblionumber" },
450   { cascade_copy => 0, cascade_delete => 0 },
451 );
452
453 =head2 tags_all
454
455 Type: has_many
456
457 Related object: L<Koha::Schema::Result::TagAll>
458
459 =cut
460
461 __PACKAGE__->has_many(
462   "tags_all",
463   "Koha::Schema::Result::TagAll",
464   { "foreign.biblionumber" => "self.biblionumber" },
465   { cascade_copy => 0, cascade_delete => 0 },
466 );
467
468 =head2 tags_indexes
469
470 Type: has_many
471
472 Related object: L<Koha::Schema::Result::TagsIndex>
473
474 =cut
475
476 __PACKAGE__->has_many(
477   "tags_indexes",
478   "Koha::Schema::Result::TagsIndex",
479   { "foreign.biblionumber" => "self.biblionumber" },
480   { cascade_copy => 0, cascade_delete => 0 },
481 );
482
483 =head2 virtualshelfcontents
484
485 Type: has_many
486
487 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
488
489 =cut
490
491 __PACKAGE__->has_many(
492   "virtualshelfcontents",
493   "Koha::Schema::Result::Virtualshelfcontent",
494   { "foreign.biblionumber" => "self.biblionumber" },
495   { cascade_copy => 0, cascade_delete => 0 },
496 );
497
498
499 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-02-03 10:03:26
500 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YVZN5K/K1v7Kj2yYGwT2CQ
501
502 __PACKAGE__->has_many(
503   "biblioitem",
504   "Koha::Schema::Result::Biblioitem",
505   { "foreign.biblionumber" => "self.biblionumber" },
506   { cascade_copy => 0, cascade_delete => 0 },
507 );
508
509 __PACKAGE__->has_one(
510   "metadata",
511   "Koha::Schema::Result::BiblioMetadata",
512   { "foreign.biblionumber" => "self.biblionumber" },
513   { cascade_copy => 0, cascade_delete => 0 },
514 );
515
516 __PACKAGE__->has_many(
517   "orders",
518   "Koha::Schema::Result::Aqorder",
519   { "foreign.biblionumber" => "self.biblionumber" },
520   { cascade_copy => 0, cascade_delete => 0 },
521 );
522
523 __PACKAGE__->add_columns(
524     "+serial" => { is_boolean => 1 }
525 );
526
527 1;