Bug 22440: DBIC schema
[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 erm_eholdings_titles
304
305 Type: has_many
306
307 Related object: L<Koha::Schema::Result::ErmEholdingsTitle>
308
309 =cut
310
311 __PACKAGE__->has_many(
312   "erm_eholdings_titles",
313   "Koha::Schema::Result::ErmEholdingsTitle",
314   { "foreign.biblio_id" => "self.biblionumber" },
315   { cascade_copy => 0, cascade_delete => 0 },
316 );
317
318 =head2 hold_fill_targets
319
320 Type: has_many
321
322 Related object: L<Koha::Schema::Result::HoldFillTarget>
323
324 =cut
325
326 __PACKAGE__->has_many(
327   "hold_fill_targets",
328   "Koha::Schema::Result::HoldFillTarget",
329   { "foreign.biblionumber" => "self.biblionumber" },
330   { cascade_copy => 0, cascade_delete => 0 },
331 );
332
333 =head2 illrequests
334
335 Type: has_many
336
337 Related object: L<Koha::Schema::Result::Illrequest>
338
339 =cut
340
341 __PACKAGE__->has_many(
342   "illrequests",
343   "Koha::Schema::Result::Illrequest",
344   { "foreign.biblio_id" => "self.biblionumber" },
345   { cascade_copy => 0, cascade_delete => 0 },
346 );
347
348 =head2 item_groups
349
350 Type: has_many
351
352 Related object: L<Koha::Schema::Result::ItemGroup>
353
354 =cut
355
356 __PACKAGE__->has_many(
357   "item_groups",
358   "Koha::Schema::Result::ItemGroup",
359   { "foreign.biblio_id" => "self.biblionumber" },
360   { cascade_copy => 0, cascade_delete => 0 },
361 );
362
363 =head2 items
364
365 Type: has_many
366
367 Related object: L<Koha::Schema::Result::Item>
368
369 =cut
370
371 __PACKAGE__->has_many(
372   "items",
373   "Koha::Schema::Result::Item",
374   { "foreign.biblionumber" => "self.biblionumber" },
375   { cascade_copy => 0, cascade_delete => 0 },
376 );
377
378 =head2 linktrackers
379
380 Type: has_many
381
382 Related object: L<Koha::Schema::Result::Linktracker>
383
384 =cut
385
386 __PACKAGE__->has_many(
387   "linktrackers",
388   "Koha::Schema::Result::Linktracker",
389   { "foreign.biblionumber" => "self.biblionumber" },
390   { cascade_copy => 0, cascade_delete => 0 },
391 );
392
393 =head2 old_reserves
394
395 Type: has_many
396
397 Related object: L<Koha::Schema::Result::OldReserve>
398
399 =cut
400
401 __PACKAGE__->has_many(
402   "old_reserves",
403   "Koha::Schema::Result::OldReserve",
404   { "foreign.biblionumber" => "self.biblionumber" },
405   { cascade_copy => 0, cascade_delete => 0 },
406 );
407
408 =head2 ratings
409
410 Type: has_many
411
412 Related object: L<Koha::Schema::Result::Rating>
413
414 =cut
415
416 __PACKAGE__->has_many(
417   "ratings",
418   "Koha::Schema::Result::Rating",
419   { "foreign.biblionumber" => "self.biblionumber" },
420   { cascade_copy => 0, cascade_delete => 0 },
421 );
422
423 =head2 recalls
424
425 Type: has_many
426
427 Related object: L<Koha::Schema::Result::Recall>
428
429 =cut
430
431 __PACKAGE__->has_many(
432   "recalls",
433   "Koha::Schema::Result::Recall",
434   { "foreign.biblio_id" => "self.biblionumber" },
435   { cascade_copy => 0, cascade_delete => 0 },
436 );
437
438 =head2 reserves
439
440 Type: has_many
441
442 Related object: L<Koha::Schema::Result::Reserve>
443
444 =cut
445
446 __PACKAGE__->has_many(
447   "reserves",
448   "Koha::Schema::Result::Reserve",
449   { "foreign.biblionumber" => "self.biblionumber" },
450   { cascade_copy => 0, cascade_delete => 0 },
451 );
452
453 =head2 reviews
454
455 Type: has_many
456
457 Related object: L<Koha::Schema::Result::Review>
458
459 =cut
460
461 __PACKAGE__->has_many(
462   "reviews",
463   "Koha::Schema::Result::Review",
464   { "foreign.biblionumber" => "self.biblionumber" },
465   { cascade_copy => 0, cascade_delete => 0 },
466 );
467
468 =head2 serials
469
470 Type: has_many
471
472 Related object: L<Koha::Schema::Result::Serial>
473
474 =cut
475
476 __PACKAGE__->has_many(
477   "serials",
478   "Koha::Schema::Result::Serial",
479   { "foreign.biblionumber" => "self.biblionumber" },
480   { cascade_copy => 0, cascade_delete => 0 },
481 );
482
483 =head2 subscriptionhistories
484
485 Type: has_many
486
487 Related object: L<Koha::Schema::Result::Subscriptionhistory>
488
489 =cut
490
491 __PACKAGE__->has_many(
492   "subscriptionhistories",
493   "Koha::Schema::Result::Subscriptionhistory",
494   { "foreign.biblionumber" => "self.biblionumber" },
495   { cascade_copy => 0, cascade_delete => 0 },
496 );
497
498 =head2 subscriptions
499
500 Type: has_many
501
502 Related object: L<Koha::Schema::Result::Subscription>
503
504 =cut
505
506 __PACKAGE__->has_many(
507   "subscriptions",
508   "Koha::Schema::Result::Subscription",
509   { "foreign.biblionumber" => "self.biblionumber" },
510   { cascade_copy => 0, cascade_delete => 0 },
511 );
512
513 =head2 suggestions
514
515 Type: has_many
516
517 Related object: L<Koha::Schema::Result::Suggestion>
518
519 =cut
520
521 __PACKAGE__->has_many(
522   "suggestions",
523   "Koha::Schema::Result::Suggestion",
524   { "foreign.biblionumber" => "self.biblionumber" },
525   { cascade_copy => 0, cascade_delete => 0 },
526 );
527
528 =head2 tags_all
529
530 Type: has_many
531
532 Related object: L<Koha::Schema::Result::TagAll>
533
534 =cut
535
536 __PACKAGE__->has_many(
537   "tags_all",
538   "Koha::Schema::Result::TagAll",
539   { "foreign.biblionumber" => "self.biblionumber" },
540   { cascade_copy => 0, cascade_delete => 0 },
541 );
542
543 =head2 tags_indexes
544
545 Type: has_many
546
547 Related object: L<Koha::Schema::Result::TagsIndex>
548
549 =cut
550
551 __PACKAGE__->has_many(
552   "tags_indexes",
553   "Koha::Schema::Result::TagsIndex",
554   { "foreign.biblionumber" => "self.biblionumber" },
555   { cascade_copy => 0, cascade_delete => 0 },
556 );
557
558 =head2 tmp_holdsqueues
559
560 Type: has_many
561
562 Related object: L<Koha::Schema::Result::TmpHoldsqueue>
563
564 =cut
565
566 __PACKAGE__->has_many(
567   "tmp_holdsqueues",
568   "Koha::Schema::Result::TmpHoldsqueue",
569   { "foreign.biblionumber" => "self.biblionumber" },
570   { cascade_copy => 0, cascade_delete => 0 },
571 );
572
573 =head2 virtualshelfcontents
574
575 Type: has_many
576
577 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
578
579 =cut
580
581 __PACKAGE__->has_many(
582   "virtualshelfcontents",
583   "Koha::Schema::Result::Virtualshelfcontent",
584   { "foreign.biblionumber" => "self.biblionumber" },
585   { cascade_copy => 0, cascade_delete => 0 },
586 );
587
588
589 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-12 07:24:19
590 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SpddykztHBO6DzVLDX+2Pw
591
592 __PACKAGE__->has_many(
593   "biblioitem",
594   "Koha::Schema::Result::Biblioitem",
595   { "foreign.biblionumber" => "self.biblionumber" },
596   { cascade_copy => 0, cascade_delete => 0 },
597 );
598
599 __PACKAGE__->has_one(
600   "metadata",
601   "Koha::Schema::Result::BiblioMetadata",
602   { "foreign.biblionumber" => "self.biblionumber" },
603   { cascade_copy => 0, cascade_delete => 0 },
604 );
605
606 __PACKAGE__->has_many(
607   "orders",
608   "Koha::Schema::Result::Aqorder",
609   { "foreign.biblionumber" => "self.biblionumber" },
610   { cascade_copy => 0, cascade_delete => 0 },
611 );
612
613 __PACKAGE__->add_columns(
614     "+serial" => { is_boolean => 1 }
615 );
616
617 1;