View | Details | Raw Unified | Return to bug 20447
Collapse All | Expand All

(-)a/Koha/Schema/Result/Biblio.pm (-2 / +17 lines)
Lines 300-305 __PACKAGE__->has_many( Link Here
300
  { cascade_copy => 0, cascade_delete => 0 },
300
  { cascade_copy => 0, cascade_delete => 0 },
301
);
301
);
302
302
303
=head2 holdings
304
305
Type: has_many
306
307
Related object: L<Koha::Schema::Result::Holding>
308
309
=cut
310
311
__PACKAGE__->has_many(
312
  "holdings",
313
  "Koha::Schema::Result::Holding",
314
  { "foreign.biblionumber" => "self.biblionumber" },
315
  { cascade_copy => 0, cascade_delete => 0 },
316
);
317
303
=head2 items
318
=head2 items
304
319
305
Type: has_many
320
Type: has_many
Lines 481-488 __PACKAGE__->has_many( Link Here
481
);
496
);
482
497
483
498
484
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
499
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
485
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nmmsZusHYNAMimE9sImSNg
500
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v242VpRrw7sl6v8cfqn1uQ
486
501
487
__PACKAGE__->has_many(
502
__PACKAGE__->has_many(
488
  "biblioitem",
503
  "biblioitem",
(-)a/Koha/Schema/Result/Branch.pm (-2 / +17 lines)
Lines 631-636 __PACKAGE__->has_many( Link Here
631
  { cascade_copy => 0, cascade_delete => 0 },
631
  { cascade_copy => 0, cascade_delete => 0 },
632
);
632
);
633
633
634
=head2 holdings
635
636
Type: has_many
637
638
Related object: L<Koha::Schema::Result::Holding>
639
640
=cut
641
642
__PACKAGE__->has_many(
643
  "holdings",
644
  "Koha::Schema::Result::Holding",
645
  { "foreign.holdingbranch" => "self.branchcode" },
646
  { cascade_copy => 0, cascade_delete => 0 },
647
);
648
634
=head2 illrequests
649
=head2 illrequests
635
650
636
Type: has_many
651
Type: has_many
Lines 887-894 __PACKAGE__->has_many( Link Here
887
);
902
);
888
903
889
904
890
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
905
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
891
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu8m3hyDhM50oTSeNTJbdg
906
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BpKZR7xoWZ4dMocH6lKC3w
892
907
893
__PACKAGE__->add_columns(
908
__PACKAGE__->add_columns(
894
    '+pickup_location' => { is_boolean => 1 }
909
    '+pickup_location' => { is_boolean => 1 }
(-)a/Koha/Schema/Result/Deleteditem.pm (-2 / +11 lines)
Lines 370-375 inventory number (MARC21 952$i) Link Here
370
370
371
Exclude this item from local holds priority
371
Exclude this item from local holds priority
372
372
373
=head2 holding_id
374
375
  data_type: 'integer'
376
  is_nullable: 1
377
378
foreign key from holdings table used to link this item to the right holdings record
379
373
=cut
380
=cut
374
381
375
__PACKAGE__->add_columns(
382
__PACKAGE__->add_columns(
Lines 480-485 __PACKAGE__->add_columns( Link Here
480
  { data_type => "varchar", is_nullable => 1, size => 32 },
487
  { data_type => "varchar", is_nullable => 1, size => 32 },
481
  "exclude_from_local_holds_priority",
488
  "exclude_from_local_holds_priority",
482
  { data_type => "tinyint", is_nullable => 1 },
489
  { data_type => "tinyint", is_nullable => 1 },
490
  "holding_id",
491
  { data_type => "integer", is_nullable => 1 },
483
);
492
);
484
493
485
=head1 PRIMARY KEY
494
=head1 PRIMARY KEY
Lines 495-502 __PACKAGE__->add_columns( Link Here
495
__PACKAGE__->set_primary_key("itemnumber");
504
__PACKAGE__->set_primary_key("itemnumber");
496
505
497
506
498
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
507
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
499
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ytND0t16cwo9dseU+JZSGQ
508
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HDZPRz/I5vlIgkw/c44QcA
500
509
501
__PACKAGE__->add_columns(
510
__PACKAGE__->add_columns(
502
    '+exclude_from_local_holds_priority' => { is_boolean => 1 },
511
    '+exclude_from_local_holds_priority' => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Holding.pm (+256 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Holding;
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::Holding
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings>
19
20
=cut
21
22
__PACKAGE__->table("holdings");
23
24
=head1 ACCESSORS
25
26
=head2 holding_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
unique identifier assigned to each holdings record
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 from biblio table used to link this record to the right bib record
42
43
=head2 frameworkcode
44
45
  data_type: 'varchar'
46
  default_value: (empty string)
47
  is_nullable: 0
48
  size: 4
49
50
foreign key from the biblio_framework table to identify which framework was used in cataloging this record
51
52
=head2 holdingbranch
53
54
  data_type: 'varchar'
55
  is_foreign_key: 1
56
  is_nullable: 1
57
  size: 10
58
59
foreign key from the branches table for the library that owns this record (MARC21 852$a)
60
61
=head2 location
62
63
  data_type: 'varchar'
64
  is_nullable: 1
65
  size: 80
66
67
authorized value for the shelving location for this record (MARC21 852$b)
68
69
=head2 ccode
70
71
  data_type: 'varchar'
72
  is_nullable: 1
73
  size: 80
74
75
authorized value for the collection code associated with this item (MARC21 852$g)
76
77
=head2 callnumber
78
79
  data_type: 'varchar'
80
  is_nullable: 1
81
  size: 255
82
83
call number (852$h+$i in MARC21)
84
85
=head2 suppress
86
87
  data_type: 'tinyint'
88
  is_nullable: 1
89
90
Boolean indicating whether the record is suppressed in OPAC
91
92
=head2 timestamp
93
94
  data_type: 'timestamp'
95
  datetime_undef_if_invalid: 1
96
  default_value: current_timestamp
97
  is_nullable: 0
98
99
date and time this record was last touched
100
101
=head2 datecreated
102
103
  data_type: 'date'
104
  datetime_undef_if_invalid: 1
105
  is_nullable: 0
106
107
the date this record was added to Koha
108
109
=head2 deleted_on
110
111
  data_type: 'datetime'
112
  datetime_undef_if_invalid: 1
113
  is_nullable: 1
114
115
the date this record was deleted
116
117
=cut
118
119
__PACKAGE__->add_columns(
120
  "holding_id",
121
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
122
  "biblionumber",
123
  {
124
    data_type      => "integer",
125
    default_value  => 0,
126
    is_foreign_key => 1,
127
    is_nullable    => 0,
128
  },
129
  "frameworkcode",
130
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
131
  "holdingbranch",
132
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
133
  "location",
134
  { data_type => "varchar", is_nullable => 1, size => 80 },
135
  "ccode",
136
  { data_type => "varchar", is_nullable => 1, size => 80 },
137
  "callnumber",
138
  { data_type => "varchar", is_nullable => 1, size => 255 },
139
  "suppress",
140
  { data_type => "tinyint", is_nullable => 1 },
141
  "timestamp",
142
  {
143
    data_type => "timestamp",
144
    datetime_undef_if_invalid => 1,
145
    default_value => \"current_timestamp",
146
    is_nullable => 0,
147
  },
148
  "datecreated",
149
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
150
  "deleted_on",
151
  {
152
    data_type => "datetime",
153
    datetime_undef_if_invalid => 1,
154
    is_nullable => 1,
155
  },
156
);
157
158
=head1 PRIMARY KEY
159
160
=over 4
161
162
=item * L</holding_id>
163
164
=back
165
166
=cut
167
168
__PACKAGE__->set_primary_key("holding_id");
169
170
=head1 RELATIONS
171
172
=head2 biblionumber
173
174
Type: belongs_to
175
176
Related object: L<Koha::Schema::Result::Biblio>
177
178
=cut
179
180
__PACKAGE__->belongs_to(
181
  "biblionumber",
182
  "Koha::Schema::Result::Biblio",
183
  { biblionumber => "biblionumber" },
184
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
185
);
186
187
=head2 holdingbranch
188
189
Type: belongs_to
190
191
Related object: L<Koha::Schema::Result::Branch>
192
193
=cut
194
195
__PACKAGE__->belongs_to(
196
  "holdingbranch",
197
  "Koha::Schema::Result::Branch",
198
  { branchcode => "holdingbranch" },
199
  {
200
    is_deferrable => 1,
201
    join_type     => "LEFT",
202
    on_delete     => "RESTRICT",
203
    on_update     => "CASCADE",
204
  },
205
);
206
207
=head2 holdings_metadatas
208
209
Type: has_many
210
211
Related object: L<Koha::Schema::Result::HoldingsMetadata>
212
213
=cut
214
215
__PACKAGE__->has_many(
216
  "holdings_metadatas",
217
  "Koha::Schema::Result::HoldingsMetadata",
218
  { "foreign.holding_id" => "self.holding_id" },
219
  { cascade_copy => 0, cascade_delete => 0 },
220
);
221
222
=head2 items
223
224
Type: has_many
225
226
Related object: L<Koha::Schema::Result::Item>
227
228
=cut
229
230
__PACKAGE__->has_many(
231
  "items",
232
  "Koha::Schema::Result::Item",
233
  { "foreign.holding_id" => "self.holding_id" },
234
  { cascade_copy => 0, cascade_delete => 0 },
235
);
236
237
238
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
239
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cb9mVGJ6TJ+GqAuqMaNEQQ
240
241
=head2 metadata
242
243
This relationship makes it possible to use metadata as a prefetch table:
244
245
my $holdings = Koha::Holdings->search({}, {prefetch => 'metadata'});
246
my $metadata = $holdings->next()->metadata();
247
248
=cut
249
250
__PACKAGE__->has_one(
251
  "metadata",
252
  "Koha::Schema::Result::HoldingsMetadata",
253
  { "foreign.holding_id" => "self.holding_id" },
254
  { cascade_copy => 0, cascade_delete => 0 },
255
);
256
1;
(-)a/Koha/Schema/Result/HoldingsMetadata.pm (+140 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::HoldingsMetadata;
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::HoldingsMetadata
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings_metadata>
19
20
=cut
21
22
__PACKAGE__->table("holdings_metadata");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 holding_id
33
34
  data_type: 'integer'
35
  is_foreign_key: 1
36
  is_nullable: 0
37
38
=head2 format
39
40
  data_type: 'varchar'
41
  is_nullable: 0
42
  size: 16
43
44
=head2 schema
45
46
  data_type: 'varchar'
47
  is_nullable: 0
48
  size: 16
49
50
=head2 metadata
51
52
  data_type: 'longtext'
53
  is_nullable: 0
54
55
=head2 deleted_on
56
57
  data_type: 'datetime'
58
  datetime_undef_if_invalid: 1
59
  is_nullable: 1
60
61
the date this record was deleted
62
63
=cut
64
65
__PACKAGE__->add_columns(
66
  "id",
67
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
68
  "holding_id",
69
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
70
  "format",
71
  { data_type => "varchar", is_nullable => 0, size => 16 },
72
  "schema",
73
  { data_type => "varchar", is_nullable => 0, size => 16 },
74
  "metadata",
75
  { data_type => "longtext", is_nullable => 0 },
76
  "deleted_on",
77
  {
78
    data_type => "datetime",
79
    datetime_undef_if_invalid => 1,
80
    is_nullable => 1,
81
  },
82
);
83
84
=head1 PRIMARY KEY
85
86
=over 4
87
88
=item * L</id>
89
90
=back
91
92
=cut
93
94
__PACKAGE__->set_primary_key("id");
95
96
=head1 UNIQUE CONSTRAINTS
97
98
=head2 C<holdings_metadata_uniq_key>
99
100
=over 4
101
102
=item * L</holding_id>
103
104
=item * L</format>
105
106
=item * L</schema>
107
108
=back
109
110
=cut
111
112
__PACKAGE__->add_unique_constraint(
113
  "holdings_metadata_uniq_key",
114
  ["holding_id", "format", "schema"],
115
);
116
117
=head1 RELATIONS
118
119
=head2 holding
120
121
Type: belongs_to
122
123
Related object: L<Koha::Schema::Result::Holding>
124
125
=cut
126
127
__PACKAGE__->belongs_to(
128
  "holding",
129
  "Koha::Schema::Result::Holding",
130
  { holding_id => "holding_id" },
131
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
132
);
133
134
135
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
136
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:msXxqOTn5rKZf188+KFk8g
137
138
139
# You can replace this text with custom code or comments, and it will be preserved on regeneration
140
1;
(-)a/Koha/Schema/Result/Item.pm (-3 / +32 lines)
Lines 374-379 inventory number (MARC21 952$i) Link Here
374
374
375
Exclude this item from local holds priority
375
Exclude this item from local holds priority
376
376
377
=head2 holding_id
378
379
  data_type: 'integer'
380
  is_foreign_key: 1
381
  is_nullable: 1
382
383
foreign key from holdings table used to link this item to the right holdings record
384
377
=cut
385
=cut
378
386
379
__PACKAGE__->add_columns(
387
__PACKAGE__->add_columns(
Lines 494-499 __PACKAGE__->add_columns( Link Here
494
  { data_type => "varchar", is_nullable => 1, size => 32 },
502
  { data_type => "varchar", is_nullable => 1, size => 32 },
495
  "exclude_from_local_holds_priority",
503
  "exclude_from_local_holds_priority",
496
  { data_type => "tinyint", is_nullable => 1 },
504
  { data_type => "tinyint", is_nullable => 1 },
505
  "holding_id",
506
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
497
);
507
);
498
508
499
=head1 PRIMARY KEY
509
=head1 PRIMARY KEY
Lines 674-679 __PACKAGE__->might_have( Link Here
674
  { cascade_copy => 0, cascade_delete => 0 },
684
  { cascade_copy => 0, cascade_delete => 0 },
675
);
685
);
676
686
687
=head2 holding
688
689
Type: belongs_to
690
691
Related object: L<Koha::Schema::Result::Holding>
692
693
=cut
694
695
__PACKAGE__->belongs_to(
696
  "holding",
697
  "Koha::Schema::Result::Holding",
698
  { holding_id => "holding_id" },
699
  {
700
    is_deferrable => 1,
701
    join_type     => "LEFT",
702
    on_delete     => "CASCADE",
703
    on_update     => "CASCADE",
704
  },
705
);
706
677
=head2 holdingbranch
707
=head2 holdingbranch
678
708
679
Type: belongs_to
709
Type: belongs_to
Lines 850-857 __PACKAGE__->has_many( Link Here
850
);
880
);
851
881
852
882
853
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
883
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2021-01-24 12:34:57
854
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U5Tm2JfUnfhACRDJ4SpFgQ
884
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OPCRh54tzKseh6b2dHhB2g
855
885
856
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
886
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
857
887
858
- 

Return to bug 20447