Line 0
Link Here
|
0 |
- |
1 |
use utf8; |
|
|
2 |
package Koha::Schema::Result::PreservationTrainsItem; |
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::PreservationTrainsItem |
10 |
|
11 |
=cut |
12 |
|
13 |
use strict; |
14 |
use warnings; |
15 |
|
16 |
use base 'DBIx::Class::Core'; |
17 |
|
18 |
=head1 TABLE: C<preservation_trains_items> |
19 |
|
20 |
=cut |
21 |
|
22 |
__PACKAGE__->table("preservation_trains_items"); |
23 |
|
24 |
=head1 ACCESSORS |
25 |
|
26 |
=head2 train_item_id |
27 |
|
28 |
data_type: 'integer' |
29 |
is_auto_increment: 1 |
30 |
is_nullable: 0 |
31 |
|
32 |
primary key |
33 |
|
34 |
=head2 train_id |
35 |
|
36 |
data_type: 'integer' |
37 |
is_foreign_key: 1 |
38 |
is_nullable: 0 |
39 |
|
40 |
link with preservation_train |
41 |
|
42 |
=head2 item_id |
43 |
|
44 |
data_type: 'integer' |
45 |
is_foreign_key: 1 |
46 |
is_nullable: 0 |
47 |
|
48 |
link with items |
49 |
|
50 |
=head2 processing_id |
51 |
|
52 |
data_type: 'integer' |
53 |
is_foreign_key: 1 |
54 |
is_nullable: 1 |
55 |
|
56 |
specific processing for this item |
57 |
|
58 |
=head2 user_train_item_id |
59 |
|
60 |
data_type: 'integer' |
61 |
is_nullable: 0 |
62 |
|
63 |
train item id for this train, starts from 1 |
64 |
|
65 |
=head2 added_on |
66 |
|
67 |
data_type: 'datetime' |
68 |
datetime_undef_if_invalid: 1 |
69 |
is_nullable: 1 |
70 |
|
71 |
added date |
72 |
|
73 |
=cut |
74 |
|
75 |
__PACKAGE__->add_columns( |
76 |
"train_item_id", |
77 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
78 |
"train_id", |
79 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, |
80 |
"item_id", |
81 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, |
82 |
"processing_id", |
83 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, |
84 |
"user_train_item_id", |
85 |
{ data_type => "integer", is_nullable => 0 }, |
86 |
"added_on", |
87 |
{ |
88 |
data_type => "datetime", |
89 |
datetime_undef_if_invalid => 1, |
90 |
is_nullable => 1, |
91 |
}, |
92 |
); |
93 |
|
94 |
=head1 PRIMARY KEY |
95 |
|
96 |
=over 4 |
97 |
|
98 |
=item * L</train_item_id> |
99 |
|
100 |
=back |
101 |
|
102 |
=cut |
103 |
|
104 |
__PACKAGE__->set_primary_key("train_item_id"); |
105 |
|
106 |
=head1 UNIQUE CONSTRAINTS |
107 |
|
108 |
=head2 C<train_id> |
109 |
|
110 |
=over 4 |
111 |
|
112 |
=item * L</train_id> |
113 |
|
114 |
=item * L</item_id> |
115 |
|
116 |
=back |
117 |
|
118 |
=cut |
119 |
|
120 |
__PACKAGE__->add_unique_constraint("train_id", ["train_id", "item_id"]); |
121 |
|
122 |
=head1 RELATIONS |
123 |
|
124 |
=head2 item |
125 |
|
126 |
Type: belongs_to |
127 |
|
128 |
Related object: L<Koha::Schema::Result::Item> |
129 |
|
130 |
=cut |
131 |
|
132 |
__PACKAGE__->belongs_to( |
133 |
"item", |
134 |
"Koha::Schema::Result::Item", |
135 |
{ itemnumber => "item_id" }, |
136 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
137 |
); |
138 |
|
139 |
=head2 preservation_processing_attributes_items |
140 |
|
141 |
Type: has_many |
142 |
|
143 |
Related object: L<Koha::Schema::Result::PreservationProcessingAttributesItem> |
144 |
|
145 |
=cut |
146 |
|
147 |
__PACKAGE__->has_many( |
148 |
"preservation_processing_attributes_items", |
149 |
"Koha::Schema::Result::PreservationProcessingAttributesItem", |
150 |
{ "foreign.train_item_id" => "self.train_item_id" }, |
151 |
{ cascade_copy => 0, cascade_delete => 0 }, |
152 |
); |
153 |
|
154 |
=head2 processing |
155 |
|
156 |
Type: belongs_to |
157 |
|
158 |
Related object: L<Koha::Schema::Result::PreservationProcessing> |
159 |
|
160 |
=cut |
161 |
|
162 |
__PACKAGE__->belongs_to( |
163 |
"processing", |
164 |
"Koha::Schema::Result::PreservationProcessing", |
165 |
{ processing_id => "processing_id" }, |
166 |
{ |
167 |
is_deferrable => 1, |
168 |
join_type => "LEFT", |
169 |
on_delete => "SET NULL", |
170 |
on_update => "CASCADE", |
171 |
}, |
172 |
); |
173 |
|
174 |
=head2 train |
175 |
|
176 |
Type: belongs_to |
177 |
|
178 |
Related object: L<Koha::Schema::Result::PreservationTrain> |
179 |
|
180 |
=cut |
181 |
|
182 |
__PACKAGE__->belongs_to( |
183 |
"train", |
184 |
"Koha::Schema::Result::PreservationTrain", |
185 |
{ train_id => "train_id" }, |
186 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
187 |
); |
188 |
|
189 |
|
190 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-17 18:47:47 |
191 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lpvjaV+qXrIDVlimBaycgA |
192 |
|
193 |
|
194 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
195 |
1; |