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

(-)a/Koha/Schema/Result/Biblio.pm (-3 / +17 lines)
Lines 270-275 __PACKAGE__->has_many( Link Here
270
  { cascade_copy => 0, cascade_delete => 0 },
270
  { cascade_copy => 0, cascade_delete => 0 },
271
);
271
);
272
272
273
=head2 holdings
274
275
Type: has_many
276
277
Related object: L<Koha::Schema::Result::Holding>
278
279
=cut
280
281
__PACKAGE__->has_many(
282
  "holdings",
283
  "Koha::Schema::Result::Holding",
284
  { "foreign.biblionumber" => "self.biblionumber" },
285
  { cascade_copy => 0, cascade_delete => 0 },
286
);
287
273
=head2 items
288
=head2 items
274
289
275
Type: has_many
290
Type: has_many
Lines 451-459 __PACKAGE__->has_many( Link Here
451
);
466
);
452
467
453
468
454
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-17 09:15:51
469
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-15 12:52:12
455
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p2SIq565zPyE3ZUkSuXyBA
470
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pMd7Zf97YHGqAAKpz/MmFg
456
457
471
458
__PACKAGE__->has_one(
472
__PACKAGE__->has_one(
459
  "metadata",
473
  "metadata",
(-)a/Koha/Schema/Result/Branch.pm (-2 / +17 lines)
Lines 578-583 __PACKAGE__->has_many( Link Here
578
  { cascade_copy => 0, cascade_delete => 0 },
578
  { cascade_copy => 0, cascade_delete => 0 },
579
);
579
);
580
580
581
=head2 holdings
582
583
Type: has_many
584
585
Related object: L<Koha::Schema::Result::Holding>
586
587
=cut
588
589
__PACKAGE__->has_many(
590
  "holdings",
591
  "Koha::Schema::Result::Holding",
592
  { "foreign.holdingbranch" => "self.branchcode" },
593
  { cascade_copy => 0, cascade_delete => 0 },
594
);
595
581
=head2 illrequests
596
=head2 illrequests
582
597
583
Type: has_many
598
Type: has_many
Lines 819-826 __PACKAGE__->has_many( Link Here
819
);
834
);
820
835
821
836
822
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2020-06-12 14:01:29
837
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-13 15:59:04
823
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hU6Ldf0uN2iV1h7llLH+4g
838
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fVZBpz5PmLW8msfjYU9e0Q
824
839
825
__PACKAGE__->add_columns(
840
__PACKAGE__->add_columns(
826
    '+pickup_location' => { is_boolean => 1 }
841
    '+pickup_location' => { is_boolean => 1 }
(-)a/Koha/Schema/Result/Deleteditem.pm (-2 / +9 lines)
Lines 282-287 __PACKAGE__->table("deleteditems"); Link Here
282
  is_nullable: 1
282
  is_nullable: 1
283
  size: 32
283
  size: 32
284
284
285
=head2 holding_id
286
287
  data_type: 'integer'
288
  is_nullable: 1
289
285
=cut
290
=cut
286
291
287
__PACKAGE__->add_columns(
292
__PACKAGE__->add_columns(
Lines 392-397 __PACKAGE__->add_columns( Link Here
392
  { data_type => "varchar", is_nullable => 1, size => 32 },
397
  { data_type => "varchar", is_nullable => 1, size => 32 },
393
  "new_status",
398
  "new_status",
394
  { data_type => "varchar", is_nullable => 1, size => 32 },
399
  { data_type => "varchar", is_nullable => 1, size => 32 },
400
  "holding_id",
401
  { data_type => "integer", is_nullable => 1 },
395
);
402
);
396
403
397
=head1 PRIMARY KEY
404
=head1 PRIMARY KEY
Lines 407-414 __PACKAGE__->add_columns( Link Here
407
__PACKAGE__->set_primary_key("itemnumber");
414
__PACKAGE__->set_primary_key("itemnumber");
408
415
409
416
410
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-27 10:38:13
417
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-15 12:37:06
411
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MsPWE8Trd034UYFcZVbCtw
418
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q8yLJ1R8WTQbpK4EMzrOdw
412
419
413
sub koha_objects_class {
420
sub koha_objects_class {
414
    'Koha::Old::Items';
421
    'Koha::Old::Items';
(-)a/Koha/Schema/Result/Holding.pm (+234 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
=head2 biblionumber
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 frameworkcode
40
41
  data_type: 'varchar'
42
  default_value: (empty string)
43
  is_nullable: 0
44
  size: 4
45
46
=head2 holdingbranch
47
48
  data_type: 'varchar'
49
  is_foreign_key: 1
50
  is_nullable: 1
51
  size: 10
52
53
=head2 location
54
55
  data_type: 'varchar'
56
  is_nullable: 1
57
  size: 80
58
59
=head2 ccode
60
61
  data_type: 'varchar'
62
  is_nullable: 1
63
  size: 80
64
65
=head2 callnumber
66
67
  data_type: 'varchar'
68
  is_nullable: 1
69
  size: 255
70
71
=head2 suppress
72
73
  data_type: 'tinyint'
74
  is_nullable: 1
75
76
=head2 timestamp
77
78
  data_type: 'timestamp'
79
  datetime_undef_if_invalid: 1
80
  default_value: current_timestamp
81
  is_nullable: 0
82
83
=head2 datecreated
84
85
  data_type: 'date'
86
  datetime_undef_if_invalid: 1
87
  is_nullable: 0
88
89
=head2 deleted_on
90
91
  data_type: 'datetime'
92
  datetime_undef_if_invalid: 1
93
  is_nullable: 1
94
95
=cut
96
97
__PACKAGE__->add_columns(
98
  "holding_id",
99
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
100
  "biblionumber",
101
  {
102
    data_type      => "integer",
103
    default_value  => 0,
104
    is_foreign_key => 1,
105
    is_nullable    => 0,
106
  },
107
  "frameworkcode",
108
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
109
  "holdingbranch",
110
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
111
  "location",
112
  { data_type => "varchar", is_nullable => 1, size => 80 },
113
  "ccode",
114
  { data_type => "varchar", is_nullable => 1, size => 80 },
115
  "callnumber",
116
  { data_type => "varchar", is_nullable => 1, size => 255 },
117
  "suppress",
118
  { data_type => "tinyint", is_nullable => 1 },
119
  "timestamp",
120
  {
121
    data_type => "timestamp",
122
    datetime_undef_if_invalid => 1,
123
    default_value => \"current_timestamp",
124
    is_nullable => 0,
125
  },
126
  "datecreated",
127
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
128
  "deleted_on",
129
  {
130
    data_type => "datetime",
131
    datetime_undef_if_invalid => 1,
132
    is_nullable => 1,
133
  },
134
);
135
136
=head1 PRIMARY KEY
137
138
=over 4
139
140
=item * L</holding_id>
141
142
=back
143
144
=cut
145
146
__PACKAGE__->set_primary_key("holding_id");
147
148
=head1 RELATIONS
149
150
=head2 biblionumber
151
152
Type: belongs_to
153
154
Related object: L<Koha::Schema::Result::Biblio>
155
156
=cut
157
158
__PACKAGE__->belongs_to(
159
  "biblionumber",
160
  "Koha::Schema::Result::Biblio",
161
  { biblionumber => "biblionumber" },
162
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
163
);
164
165
=head2 holdingbranch
166
167
Type: belongs_to
168
169
Related object: L<Koha::Schema::Result::Branch>
170
171
=cut
172
173
__PACKAGE__->belongs_to(
174
  "holdingbranch",
175
  "Koha::Schema::Result::Branch",
176
  { branchcode => "holdingbranch" },
177
  {
178
    is_deferrable => 1,
179
    join_type     => "LEFT",
180
    on_delete     => "RESTRICT",
181
    on_update     => "CASCADE",
182
  },
183
);
184
185
=head2 holdings_metadatas
186
187
Type: has_many
188
189
Related object: L<Koha::Schema::Result::HoldingsMetadata>
190
191
=cut
192
193
__PACKAGE__->has_many(
194
  "holdings_metadatas",
195
  "Koha::Schema::Result::HoldingsMetadata",
196
  { "foreign.holding_id" => "self.holding_id" },
197
  { cascade_copy => 0, cascade_delete => 0 },
198
);
199
200
=head2 items
201
202
Type: has_many
203
204
Related object: L<Koha::Schema::Result::Item>
205
206
=cut
207
208
__PACKAGE__->has_many(
209
  "items",
210
  "Koha::Schema::Result::Item",
211
  { "foreign.holding_id" => "self.holding_id" },
212
  { cascade_copy => 0, cascade_delete => 0 },
213
);
214
215
216
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-15 12:37:06
217
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r5dS7lMIAG11s3PYFp/NKQ
218
219
=head2 metadata
220
221
This relationship makes it possible to use metadata as a prefetch table:
222
223
my $holdings = Koha::Holdings->search({}, {prefetch => 'metadata'});
224
my $metadata = $holdings->next()->metadata();
225
226
=cut
227
228
__PACKAGE__->has_one(
229
  "metadata",
230
  "Koha::Schema::Result::HoldingsMetadata",
231
  { "foreign.holding_id" => "self.holding_id" },
232
  { cascade_copy => 0, cascade_delete => 0 },
233
);
234
1;
(-)a/Koha/Schema/Result/HoldingsMetadata.pm (+138 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
=cut
62
63
__PACKAGE__->add_columns(
64
  "id",
65
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
66
  "holding_id",
67
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
68
  "format",
69
  { data_type => "varchar", is_nullable => 0, size => 16 },
70
  "schema",
71
  { data_type => "varchar", is_nullable => 0, size => 16 },
72
  "metadata",
73
  { data_type => "longtext", is_nullable => 0 },
74
  "deleted_on",
75
  {
76
    data_type => "datetime",
77
    datetime_undef_if_invalid => 1,
78
    is_nullable => 1,
79
  },
80
);
81
82
=head1 PRIMARY KEY
83
84
=over 4
85
86
=item * L</id>
87
88
=back
89
90
=cut
91
92
__PACKAGE__->set_primary_key("id");
93
94
=head1 UNIQUE CONSTRAINTS
95
96
=head2 C<holdings_metadata_uniq_key>
97
98
=over 4
99
100
=item * L</holding_id>
101
102
=item * L</format>
103
104
=item * L</schema>
105
106
=back
107
108
=cut
109
110
__PACKAGE__->add_unique_constraint(
111
  "holdings_metadata_uniq_key",
112
  ["holding_id", "format", "schema"],
113
);
114
115
=head1 RELATIONS
116
117
=head2 holding
118
119
Type: belongs_to
120
121
Related object: L<Koha::Schema::Result::Holding>
122
123
=cut
124
125
__PACKAGE__->belongs_to(
126
  "holding",
127
  "Koha::Schema::Result::Holding",
128
  { holding_id => "holding_id" },
129
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
130
);
131
132
133
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-02-20 16:55:21
134
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:42bY17ncjs1OZKH23z4SgQ
135
136
137
# You can replace this text with custom code or comments, and it will be preserved on regeneration
138
1;
(-)a/Koha/Schema/Result/Item.pm (-3 / +30 lines)
Lines 286-291 __PACKAGE__->table("items"); Link Here
286
  is_nullable: 1
286
  is_nullable: 1
287
  size: 32
287
  size: 32
288
288
289
=head2 holding_id
290
291
  data_type: 'integer'
292
  is_foreign_key: 1
293
  is_nullable: 1
294
289
=cut
295
=cut
290
296
291
__PACKAGE__->add_columns(
297
__PACKAGE__->add_columns(
Lines 406-411 __PACKAGE__->add_columns( Link Here
406
  { data_type => "varchar", is_nullable => 1, size => 32 },
412
  { data_type => "varchar", is_nullable => 1, size => 32 },
407
  "new_status",
413
  "new_status",
408
  { data_type => "varchar", is_nullable => 1, size => 32 },
414
  { data_type => "varchar", is_nullable => 1, size => 32 },
415
  "holding_id",
416
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
409
);
417
);
410
418
411
=head1 PRIMARY KEY
419
=head1 PRIMARY KEY
Lines 571-576 __PACKAGE__->might_have( Link Here
571
  { cascade_copy => 0, cascade_delete => 0 },
579
  { cascade_copy => 0, cascade_delete => 0 },
572
);
580
);
573
581
582
=head2 holding
583
584
Type: belongs_to
585
586
Related object: L<Koha::Schema::Result::Holding>
587
588
=cut
589
590
__PACKAGE__->belongs_to(
591
  "holding",
592
  "Koha::Schema::Result::Holding",
593
  { holding_id => "holding_id" },
594
  {
595
    is_deferrable => 1,
596
    join_type     => "LEFT",
597
    on_delete     => "CASCADE",
598
    on_update     => "CASCADE",
599
  },
600
);
601
574
=head2 holdingbranch
602
=head2 holdingbranch
575
603
576
Type: belongs_to
604
Type: belongs_to
Lines 747-754 __PACKAGE__->has_many( Link Here
747
);
775
);
748
776
749
777
750
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-27 10:38:13
778
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-05-15 12:37:06
751
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IpI7wRweeZCbCeU1LhZbRQ
779
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X8RMSCA6gWrL1aIMokCQYg
752
780
753
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
781
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
754
782
755
- 

Return to bug 20447