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

(-)a/Koha/Schema/Result/Item.pm (-2 / +17 lines)
Lines 852-857 __PACKAGE__->has_many( Link Here
852
  { cascade_copy => 0, cascade_delete => 0 },
852
  { cascade_copy => 0, cascade_delete => 0 },
853
);
853
);
854
854
855
=head2 preservation_trains_items
856
857
Type: has_many
858
859
Related object: L<Koha::Schema::Result::PreservationTrainsItem>
860
861
=cut
862
863
__PACKAGE__->has_many(
864
  "preservation_trains_items",
865
  "Koha::Schema::Result::PreservationTrainsItem",
866
  { "foreign.item_id" => "self.itemnumber" },
867
  { cascade_copy => 0, cascade_delete => 0 },
868
);
869
855
=head2 recalls
870
=head2 recalls
856
871
857
Type: has_many
872
Type: has_many
Lines 943-950 __PACKAGE__->might_have( Link Here
943
);
958
);
944
959
945
960
946
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-26 17:44:52
961
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-31 11:33:55
947
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FHB+BvL4it4HrzlfNCxoKw
962
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w/riz2YWgVUds0eMqZuGTg
948
963
949
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
964
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
950
965
(-)a/Koha/Schema/Result/PreservationProcessing.pm (+116 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::PreservationProcessing;
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::PreservationProcessing
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<preservation_processings>
19
20
=cut
21
22
__PACKAGE__->table("preservation_processings");
23
24
=head1 ACCESSORS
25
26
=head2 processing_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
primary key
33
34
=head2 name
35
36
  data_type: 'varchar'
37
  is_nullable: 0
38
  size: 80
39
40
name of the processing
41
42
=cut
43
44
__PACKAGE__->add_columns(
45
  "processing_id",
46
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
47
  "name",
48
  { data_type => "varchar", is_nullable => 0, size => 80 },
49
);
50
51
=head1 PRIMARY KEY
52
53
=over 4
54
55
=item * L</processing_id>
56
57
=back
58
59
=cut
60
61
__PACKAGE__->set_primary_key("processing_id");
62
63
=head1 RELATIONS
64
65
=head2 preservation_processing_attributes
66
67
Type: has_many
68
69
Related object: L<Koha::Schema::Result::PreservationProcessingAttribute>
70
71
=cut
72
73
__PACKAGE__->has_many(
74
  "preservation_processing_attributes",
75
  "Koha::Schema::Result::PreservationProcessingAttribute",
76
  { "foreign.processing_id" => "self.processing_id" },
77
  { cascade_copy => 0, cascade_delete => 0 },
78
);
79
80
=head2 preservation_trains
81
82
Type: has_many
83
84
Related object: L<Koha::Schema::Result::PreservationTrain>
85
86
=cut
87
88
__PACKAGE__->has_many(
89
  "preservation_trains",
90
  "Koha::Schema::Result::PreservationTrain",
91
  { "foreign.default_processing_id" => "self.processing_id" },
92
  { cascade_copy => 0, cascade_delete => 0 },
93
);
94
95
=head2 preservation_trains_items
96
97
Type: has_many
98
99
Related object: L<Koha::Schema::Result::PreservationTrainsItem>
100
101
=cut
102
103
__PACKAGE__->has_many(
104
  "preservation_trains_items",
105
  "Koha::Schema::Result::PreservationTrainsItem",
106
  { "foreign.processing_id" => "self.processing_id" },
107
  { cascade_copy => 0, cascade_delete => 0 },
108
);
109
110
111
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-17 18:47:47
112
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m7bHppTX3UpQY9CfmRPqQA
113
114
115
# You can replace this text with custom code or comments, and it will be preserved on regeneration
116
1;
(-)a/Koha/Schema/Result/PreservationProcessingAttribute.pm (+137 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::PreservationProcessingAttribute;
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::PreservationProcessingAttribute
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<preservation_processing_attributes>
19
20
=cut
21
22
__PACKAGE__->table("preservation_processing_attributes");
23
24
=head1 ACCESSORS
25
26
=head2 processing_attribute_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
primary key
33
34
=head2 processing_id
35
36
  data_type: 'integer'
37
  is_foreign_key: 1
38
  is_nullable: 0
39
40
link to the processing
41
42
=head2 name
43
44
  data_type: 'varchar'
45
  is_nullable: 0
46
  size: 80
47
48
name of the processing attribute
49
50
=head2 type
51
52
  data_type: 'enum'
53
  extra: {list => ["authorised_value","free_text","db_column"]}
54
  is_nullable: 0
55
56
Type of the processing attribute
57
58
=head2 option_source
59
60
  data_type: 'varchar'
61
  is_nullable: 1
62
  size: 80
63
64
source of the possible options for this attribute
65
66
=cut
67
68
__PACKAGE__->add_columns(
69
  "processing_attribute_id",
70
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71
  "processing_id",
72
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
73
  "name",
74
  { data_type => "varchar", is_nullable => 0, size => 80 },
75
  "type",
76
  {
77
    data_type => "enum",
78
    extra => { list => ["authorised_value", "free_text", "db_column"] },
79
    is_nullable => 0,
80
  },
81
  "option_source",
82
  { data_type => "varchar", is_nullable => 1, size => 80 },
83
);
84
85
=head1 PRIMARY KEY
86
87
=over 4
88
89
=item * L</processing_attribute_id>
90
91
=back
92
93
=cut
94
95
__PACKAGE__->set_primary_key("processing_attribute_id");
96
97
=head1 RELATIONS
98
99
=head2 preservation_processing_attributes_items
100
101
Type: has_many
102
103
Related object: L<Koha::Schema::Result::PreservationProcessingAttributesItem>
104
105
=cut
106
107
__PACKAGE__->has_many(
108
  "preservation_processing_attributes_items",
109
  "Koha::Schema::Result::PreservationProcessingAttributesItem",
110
  {
111
    "foreign.processing_attribute_id" => "self.processing_attribute_id",
112
  },
113
  { cascade_copy => 0, cascade_delete => 0 },
114
);
115
116
=head2 processing
117
118
Type: belongs_to
119
120
Related object: L<Koha::Schema::Result::PreservationProcessing>
121
122
=cut
123
124
__PACKAGE__->belongs_to(
125
  "processing",
126
  "Koha::Schema::Result::PreservationProcessing",
127
  { processing_id => "processing_id" },
128
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
129
);
130
131
132
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-17 18:47:47
133
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:i0vFmFYaqiZFyXGxDp+6oQ
134
135
136
# You can replace this text with custom code or comments, and it will be preserved on regeneration
137
1;
(-)a/Koha/Schema/Result/PreservationProcessingAttributesItem.pm (+113 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::PreservationProcessingAttributesItem;
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::PreservationProcessingAttributesItem
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<preservation_processing_attributes_items>
19
20
=cut
21
22
__PACKAGE__->table("preservation_processing_attributes_items");
23
24
=head1 ACCESSORS
25
26
=head2 processing_attribute_id
27
28
  data_type: 'integer'
29
  is_foreign_key: 1
30
  is_nullable: 0
31
32
link with preservation_processing_attributes
33
34
=head2 train_item_id
35
36
  data_type: 'integer'
37
  is_foreign_key: 1
38
  is_nullable: 0
39
40
link with preservation_trains_items
41
42
=head2 value
43
44
  data_type: 'varchar'
45
  is_nullable: 1
46
  size: 255
47
48
value for this attribute
49
50
=cut
51
52
__PACKAGE__->add_columns(
53
  "processing_attribute_id",
54
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
55
  "train_item_id",
56
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
57
  "value",
58
  { data_type => "varchar", is_nullable => 1, size => 255 },
59
);
60
61
=head1 PRIMARY KEY
62
63
=over 4
64
65
=item * L</processing_attribute_id>
66
67
=item * L</train_item_id>
68
69
=back
70
71
=cut
72
73
__PACKAGE__->set_primary_key("processing_attribute_id", "train_item_id");
74
75
=head1 RELATIONS
76
77
=head2 processing_attribute
78
79
Type: belongs_to
80
81
Related object: L<Koha::Schema::Result::PreservationProcessingAttribute>
82
83
=cut
84
85
__PACKAGE__->belongs_to(
86
  "processing_attribute",
87
  "Koha::Schema::Result::PreservationProcessingAttribute",
88
  { processing_attribute_id => "processing_attribute_id" },
89
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
90
);
91
92
=head2 train_item
93
94
Type: belongs_to
95
96
Related object: L<Koha::Schema::Result::PreservationTrainsItem>
97
98
=cut
99
100
__PACKAGE__->belongs_to(
101
  "train_item",
102
  "Koha::Schema::Result::PreservationTrainsItem",
103
  { train_item_id => "train_item_id" },
104
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
105
);
106
107
108
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-17 18:47:47
109
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CiFAelBwfhQzRX1cL0ssqA
110
111
112
# You can replace this text with custom code or comments, and it will be preserved on regeneration
113
1;
(-)a/Koha/Schema/Result/PreservationTrain.pm (+195 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::PreservationTrain;
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::PreservationTrain
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<preservation_trains>
19
20
=cut
21
22
__PACKAGE__->table("preservation_trains");
23
24
=head1 ACCESSORS
25
26
=head2 train_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
primary key
33
34
=head2 name
35
36
  data_type: 'varchar'
37
  is_nullable: 0
38
  size: 80
39
40
name of the train
41
42
=head2 description
43
44
  data_type: 'varchar'
45
  is_nullable: 1
46
  size: 255
47
48
description of the train
49
50
=head2 default_processing_id
51
52
  data_type: 'integer'
53
  is_foreign_key: 1
54
  is_nullable: 1
55
56
default processing, link to preservation_processings.processing_id
57
58
=head2 not_for_loan
59
60
  data_type: 'varchar'
61
  default_value: 0
62
  is_nullable: 0
63
  size: 80
64
65
NOT_LOAN authorised value to apply toitem added to this train
66
67
=head2 created_on
68
69
  data_type: 'timestamp'
70
  datetime_undef_if_invalid: 1
71
  default_value: current_timestamp
72
  is_nullable: 0
73
74
creation date
75
76
=head2 closed_on
77
78
  data_type: 'datetime'
79
  datetime_undef_if_invalid: 1
80
  is_nullable: 1
81
82
closing date
83
84
=head2 sent_on
85
86
  data_type: 'datetime'
87
  datetime_undef_if_invalid: 1
88
  is_nullable: 1
89
90
sending date
91
92
=head2 received_on
93
94
  data_type: 'datetime'
95
  datetime_undef_if_invalid: 1
96
  is_nullable: 1
97
98
receiving date
99
100
=cut
101
102
__PACKAGE__->add_columns(
103
  "train_id",
104
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
105
  "name",
106
  { data_type => "varchar", is_nullable => 0, size => 80 },
107
  "description",
108
  { data_type => "varchar", is_nullable => 1, size => 255 },
109
  "default_processing_id",
110
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
111
  "not_for_loan",
112
  { data_type => "varchar", default_value => 0, is_nullable => 0, size => 80 },
113
  "created_on",
114
  {
115
    data_type => "timestamp",
116
    datetime_undef_if_invalid => 1,
117
    default_value => \"current_timestamp",
118
    is_nullable => 0,
119
  },
120
  "closed_on",
121
  {
122
    data_type => "datetime",
123
    datetime_undef_if_invalid => 1,
124
    is_nullable => 1,
125
  },
126
  "sent_on",
127
  {
128
    data_type => "datetime",
129
    datetime_undef_if_invalid => 1,
130
    is_nullable => 1,
131
  },
132
  "received_on",
133
  {
134
    data_type => "datetime",
135
    datetime_undef_if_invalid => 1,
136
    is_nullable => 1,
137
  },
138
);
139
140
=head1 PRIMARY KEY
141
142
=over 4
143
144
=item * L</train_id>
145
146
=back
147
148
=cut
149
150
__PACKAGE__->set_primary_key("train_id");
151
152
=head1 RELATIONS
153
154
=head2 default_processing
155
156
Type: belongs_to
157
158
Related object: L<Koha::Schema::Result::PreservationProcessing>
159
160
=cut
161
162
__PACKAGE__->belongs_to(
163
  "default_processing",
164
  "Koha::Schema::Result::PreservationProcessing",
165
  { processing_id => "default_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 preservation_trains_items
175
176
Type: has_many
177
178
Related object: L<Koha::Schema::Result::PreservationTrainsItem>
179
180
=cut
181
182
__PACKAGE__->has_many(
183
  "preservation_trains_items",
184
  "Koha::Schema::Result::PreservationTrainsItem",
185
  { "foreign.train_id" => "self.train_id" },
186
  { cascade_copy => 0, cascade_delete => 0 },
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:ojxQ0wFj2datCPVjeuTBWw
192
193
194
# You can replace this text with custom code or comments, and it will be preserved on regeneration
195
1;
(-)a/Koha/Schema/Result/PreservationTrainsItem.pm (-1 / +195 lines)
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;

Return to bug 30708