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

(-)a/Koha/Schema/Result/Biblio.pm (-5 / +19 lines)
Lines 95-101 __PACKAGE__->table("biblio"); Link Here
95
95
96
  data_type: 'timestamp'
96
  data_type: 'timestamp'
97
  datetime_undef_if_invalid: 1
97
  datetime_undef_if_invalid: 1
98
  default_value: current_timestamp
98
  default_value: 'current_timestamp()'
99
  is_nullable: 0
99
  is_nullable: 0
100
100
101
=head2 datecreated
101
=head2 datecreated
Lines 142-148 __PACKAGE__->add_columns( Link Here
142
  {
142
  {
143
    data_type => "timestamp",
143
    data_type => "timestamp",
144
    datetime_undef_if_invalid => 1,
144
    datetime_undef_if_invalid => 1,
145
    default_value => \"current_timestamp",
145
    default_value => "current_timestamp()",
146
    is_nullable => 0,
146
    is_nullable => 0,
147
  },
147
  },
148
  "datecreated",
148
  "datecreated",
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 406-414 __PACKAGE__->has_many( Link Here
406
);
421
);
407
422
408
423
409
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47
424
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-10-22 14:31:28
410
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:otCex8qzJmZyc+JXpKNdpQ
425
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g0rkSOW+jcTcRcbGx0qjUg
411
412
426
413
__PACKAGE__->has_one(
427
__PACKAGE__->has_one(
414
  "metadata",
428
  "metadata",
(-)a/Koha/Schema/Result/Branch.pm (-2 / +17 lines)
Lines 541-546 __PACKAGE__->has_many( Link Here
541
  { cascade_copy => 0, cascade_delete => 0 },
541
  { cascade_copy => 0, cascade_delete => 0 },
542
);
542
);
543
543
544
=head2 holdings
545
546
Type: has_many
547
548
Related object: L<Koha::Schema::Result::Holding>
549
550
=cut
551
552
__PACKAGE__->has_many(
553
  "holdings",
554
  "Koha::Schema::Result::Holding",
555
  { "foreign.holdingbranch" => "self.branchcode" },
556
  { cascade_copy => 0, cascade_delete => 0 },
557
);
558
544
=head2 illrequests
559
=head2 illrequests
545
560
546
Type: has_many
561
Type: has_many
Lines 737-744 __PACKAGE__->has_many( Link Here
737
);
752
);
738
753
739
754
740
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-12-26 10:51:35
755
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-01-23 13:01:10
741
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vxx2lpU/W6cC5muhVAO1jw
756
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7oW4K4ucA8Ee/H1RzKpHOw
742
757
743
__PACKAGE__->add_columns(
758
__PACKAGE__->add_columns(
744
    '+pickup_location' => { is_boolean => 1 }
759
    '+pickup_location' => { 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 @ 2019-02-20 16:55:21
217
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:euhmcjiKZIgn7oueD8D9mQ
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 (-5 / +32 lines)
Lines 202-208 __PACKAGE__->table("items"); Link Here
202
202
203
  data_type: 'timestamp'
203
  data_type: 'timestamp'
204
  datetime_undef_if_invalid: 1
204
  datetime_undef_if_invalid: 1
205
  default_value: current_timestamp
205
  default_value: 'current_timestamp()'
206
  is_nullable: 0
206
  is_nullable: 0
207
207
208
=head2 location
208
=head2 location
Lines 285-290 __PACKAGE__->table("items"); Link Here
285
  is_nullable: 1
285
  is_nullable: 1
286
  size: 32
286
  size: 32
287
287
288
=head2 holding_id
289
290
  data_type: 'integer'
291
  is_foreign_key: 1
292
  is_nullable: 1
293
288
=cut
294
=cut
289
295
290
__PACKAGE__->add_columns(
296
__PACKAGE__->add_columns(
Lines 374-380 __PACKAGE__->add_columns( Link Here
374
  {
380
  {
375
    data_type => "timestamp",
381
    data_type => "timestamp",
376
    datetime_undef_if_invalid => 1,
382
    datetime_undef_if_invalid => 1,
377
    default_value => \"current_timestamp",
383
    default_value => "current_timestamp()",
378
    is_nullable => 0,
384
    is_nullable => 0,
379
  },
385
  },
380
  "location",
386
  "location",
Lines 405-410 __PACKAGE__->add_columns( Link Here
405
  { data_type => "varchar", is_nullable => 1, size => 32 },
411
  { data_type => "varchar", is_nullable => 1, size => 32 },
406
  "new_status",
412
  "new_status",
407
  { data_type => "varchar", is_nullable => 1, size => 32 },
413
  { data_type => "varchar", is_nullable => 1, size => 32 },
414
  "holding_id",
415
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
408
);
416
);
409
417
410
=head1 PRIMARY KEY
418
=head1 PRIMARY KEY
Lines 570-575 __PACKAGE__->might_have( Link Here
570
  { cascade_copy => 0, cascade_delete => 0 },
578
  { cascade_copy => 0, cascade_delete => 0 },
571
);
579
);
572
580
581
=head2 holding
582
583
Type: belongs_to
584
585
Related object: L<Koha::Schema::Result::Holding>
586
587
=cut
588
589
__PACKAGE__->belongs_to(
590
  "holding",
591
  "Koha::Schema::Result::Holding",
592
  { holding_id => "holding_id" },
593
  {
594
    is_deferrable => 1,
595
    join_type     => "LEFT",
596
    on_delete     => "CASCADE",
597
    on_update     => "CASCADE",
598
  },
599
);
600
573
=head2 holdingbranch
601
=head2 holdingbranch
574
602
575
Type: belongs_to
603
Type: belongs_to
Lines 746-753 __PACKAGE__->has_many( Link Here
746
);
774
);
747
775
748
776
749
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-17 10:42:24
777
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-18 10:03:47
750
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CcrMhgq+PQ1MHV6jZEN8wA
778
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F+7S6/IlkvPolqwgnJPwdw
751
779
752
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
780
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
753
781
754
- 

Return to bug 20447