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 (+262 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
  default_value: 0
89
  is_nullable: 0
90
91
Boolean indicating whether the record is suppressed in OPAC
92
93
=head2 timestamp
94
95
  data_type: 'timestamp'
96
  datetime_undef_if_invalid: 1
97
  default_value: current_timestamp
98
  is_nullable: 0
99
100
date and time this record was last touched
101
102
=head2 datecreated
103
104
  data_type: 'date'
105
  datetime_undef_if_invalid: 1
106
  is_nullable: 0
107
108
the date this record was added to Koha
109
110
=head2 deleted_on
111
112
  data_type: 'datetime'
113
  datetime_undef_if_invalid: 1
114
  is_nullable: 1
115
116
the date this record was deleted
117
118
=cut
119
120
__PACKAGE__->add_columns(
121
  "holding_id",
122
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
123
  "biblionumber",
124
  {
125
    data_type      => "integer",
126
    default_value  => 0,
127
    is_foreign_key => 1,
128
    is_nullable    => 0,
129
  },
130
  "frameworkcode",
131
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
132
  "holdingbranch",
133
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
134
  "location",
135
  { data_type => "varchar", is_nullable => 1, size => 80 },
136
  "ccode",
137
  { data_type => "varchar", is_nullable => 1, size => 80 },
138
  "callnumber",
139
  { data_type => "varchar", is_nullable => 1, size => 255 },
140
  "suppress",
141
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
142
  "timestamp",
143
  {
144
    data_type => "timestamp",
145
    datetime_undef_if_invalid => 1,
146
    default_value => \"current_timestamp",
147
    is_nullable => 0,
148
  },
149
  "datecreated",
150
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
151
  "deleted_on",
152
  {
153
    data_type => "datetime",
154
    datetime_undef_if_invalid => 1,
155
    is_nullable => 1,
156
  },
157
);
158
159
=head1 PRIMARY KEY
160
161
=over 4
162
163
=item * L</holding_id>
164
165
=back
166
167
=cut
168
169
__PACKAGE__->set_primary_key("holding_id");
170
171
=head1 RELATIONS
172
173
=head2 biblionumber
174
175
Type: belongs_to
176
177
Related object: L<Koha::Schema::Result::Biblio>
178
179
=cut
180
181
__PACKAGE__->belongs_to(
182
  "biblionumber",
183
  "Koha::Schema::Result::Biblio",
184
  { biblionumber => "biblionumber" },
185
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
186
);
187
188
=head2 holdingbranch
189
190
Type: belongs_to
191
192
Related object: L<Koha::Schema::Result::Branch>
193
194
=cut
195
196
__PACKAGE__->belongs_to(
197
  "holdingbranch",
198
  "Koha::Schema::Result::Branch",
199
  { branchcode => "holdingbranch" },
200
  {
201
    is_deferrable => 1,
202
    join_type     => "LEFT",
203
    on_delete     => "RESTRICT",
204
    on_update     => "CASCADE",
205
  },
206
);
207
208
=head2 holdings_metadatas
209
210
Type: has_many
211
212
Related object: L<Koha::Schema::Result::HoldingsMetadata>
213
214
=cut
215
216
__PACKAGE__->has_many(
217
  "holdings_metadatas",
218
  "Koha::Schema::Result::HoldingsMetadata",
219
  { "foreign.holding_id" => "self.holding_id" },
220
  { cascade_copy => 0, cascade_delete => 0 },
221
);
222
223
=head2 items
224
225
Type: has_many
226
227
Related object: L<Koha::Schema::Result::Item>
228
229
=cut
230
231
__PACKAGE__->has_many(
232
  "items",
233
  "Koha::Schema::Result::Item",
234
  { "foreign.holding_id" => "self.holding_id" },
235
  { cascade_copy => 0, cascade_delete => 0 },
236
);
237
238
239
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-03-19 12:18:01
240
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Q9Pn2fbd7/xNx7heNn/n5Q
241
242
=head2 metadata
243
244
This relationship makes it possible to use metadata as a prefetch table:
245
246
my $holdings = Koha::Holdings->search({}, {prefetch => 'metadata'});
247
my $metadata = $holdings->next()->metadata();
248
249
=cut
250
251
__PACKAGE__->has_one(
252
  "metadata",
253
  "Koha::Schema::Result::HoldingsMetadata",
254
  { "foreign.holding_id" => "self.holding_id" },
255
  { cascade_copy => 0, cascade_delete => 0 },
256
);
257
258
__PACKAGE__->add_columns(
259
    '+suppress' => { is_boolean => 1 },
260
);
261
262
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