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

(-)a/Koha/Schema/Result/Biblio.pm (-4 / +19 lines)
Lines 53-59 __PACKAGE__->table("biblio"); Link Here
53
53
54
=head2 subtitle
54
=head2 subtitle
55
55
56
  data_type: 'longtext'
56
  data_type: 'text'
57
  is_nullable: 1
57
  is_nullable: 1
58
58
59
=head2 part_number
59
=head2 part_number
Lines 123-129 __PACKAGE__->add_columns( Link Here
123
  "medium",
123
  "medium",
124
  { data_type => "longtext", is_nullable => 1 },
124
  { data_type => "longtext", is_nullable => 1 },
125
  "subtitle",
125
  "subtitle",
126
  { data_type => "longtext", is_nullable => 1 },
126
  { data_type => "text", is_nullable => 1 },
127
  "part_number",
127
  "part_number",
128
  { data_type => "longtext", is_nullable => 1 },
128
  { data_type => "longtext", is_nullable => 1 },
129
  "part_name",
129
  "part_name",
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-458 __PACKAGE__->has_many( Link Here
451
);
466
);
452
467
453
468
454
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-12 09:13:32
469
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-22 10:51:41
455
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R4PNOXHa9cRIx/up7HWz4Q
470
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q41/EGYCrmV/oa8lbuPnnA
456
471
457
472
458
__PACKAGE__->has_one(
473
__PACKAGE__->has_one(
(-)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 834-841 __PACKAGE__->has_many( Link Here
834
);
849
);
835
850
836
851
837
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-23 20:02:36
852
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-22 10:51:41
838
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OB75ORKajzt+l0w9mRFX1Q
853
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HzuYjaXt0aOMAjUqTSY+iQ
839
854
840
__PACKAGE__->add_columns(
855
__PACKAGE__->add_columns(
841
    '+pickup_location' => { is_boolean => 1 }
856
    '+pickup_location' => { is_boolean => 1 }
(-)a/Koha/Schema/Result/Deleteditem.pm (-2 / +9 lines)
Lines 282-287 __PACKAGE__->table("deleteditems"); Link Here
282
  data_type: 'tinyint'
282
  data_type: 'tinyint'
283
  is_nullable: 1
283
  is_nullable: 1
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
  "exclude_from_local_holds_priority",
398
  "exclude_from_local_holds_priority",
394
  { data_type => "tinyint", is_nullable => 1 },
399
  { data_type => "tinyint", is_nullable => 1 },
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.07049 @ 2020-09-30 15:31:01
417
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-22 10:51:41
411
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1l4g7uiQo9gkdrWbNxAsJg
418
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vUBgNm4rWJ2ZyCWplooNBg
412
419
413
__PACKAGE__->add_columns(
420
__PACKAGE__->add_columns(
414
    '+exclude_from_local_holds_priority' => { is_boolean => 1 },
421
    '+exclude_from_local_holds_priority' => { is_boolean => 1 },
(-)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
  data_type: 'tinyint'
286
  data_type: 'tinyint'
287
  is_nullable: 1
287
  is_nullable: 1
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
  "exclude_from_local_holds_priority",
413
  "exclude_from_local_holds_priority",
408
  { data_type => "tinyint", is_nullable => 1 },
414
  { data_type => "tinyint", is_nullable => 1 },
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 586-591 __PACKAGE__->might_have( Link Here
586
  { cascade_copy => 0, cascade_delete => 0 },
594
  { cascade_copy => 0, cascade_delete => 0 },
587
);
595
);
588
596
597
=head2 holding
598
599
Type: belongs_to
600
601
Related object: L<Koha::Schema::Result::Holding>
602
603
=cut
604
605
__PACKAGE__->belongs_to(
606
  "holding",
607
  "Koha::Schema::Result::Holding",
608
  { holding_id => "holding_id" },
609
  {
610
    is_deferrable => 1,
611
    join_type     => "LEFT",
612
    on_delete     => "CASCADE",
613
    on_update     => "CASCADE",
614
  },
615
);
616
589
=head2 holdingbranch
617
=head2 holdingbranch
590
618
591
Type: belongs_to
619
Type: belongs_to
Lines 762-769 __PACKAGE__->has_many( Link Here
762
);
790
);
763
791
764
792
765
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-12 09:13:32
793
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-22 10:51:41
766
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pmAVO6LxCb6wAJvfh+rndw
794
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kBn7/FDT6yH5HRwseri6rg
767
795
768
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
796
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
769
797
770
- 

Return to bug 20447