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

(-)a/Koha/Schema/Result/BorrowerAttributeType.pm (-29 / +27 lines)
Lines 111-125 foreign key from authorised_values that links this custom field to an authorized Link Here
111
111
112
defines if this field displays in checkout screens
112
defines if this field displays in checkout screens
113
113
114
=head2 category_code
115
116
  data_type: 'varchar'
117
  is_foreign_key: 1
118
  is_nullable: 1
119
  size: 10
120
121
defines a category for an attribute_type
122
123
=head2 class
114
=head2 class
124
115
125
  data_type: 'varchar'
116
  data_type: 'varchar'
Lines 170-177 __PACKAGE__->add_columns( Link Here
170
  { data_type => "varchar", is_nullable => 1, size => 32 },
161
  { data_type => "varchar", is_nullable => 1, size => 32 },
171
  "display_checkout",
162
  "display_checkout",
172
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
163
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
173
  "category_code",
174
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
175
  "class",
164
  "class",
176
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
165
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
177
  "keep_for_pseudonymization",
166
  "keep_for_pseudonymization",
Lines 209-247 __PACKAGE__->has_many( Link Here
209
  { cascade_copy => 0, cascade_delete => 0 },
198
  { cascade_copy => 0, cascade_delete => 0 },
210
);
199
);
211
200
212
=head2 borrower_attributes
201
=head2 borrower_attribute_types_categories
213
202
214
Type: has_many
203
Type: has_many
215
204
216
Related object: L<Koha::Schema::Result::BorrowerAttribute>
205
Related object: L<Koha::Schema::Result::BorrowerAttributeTypesCategory>
217
206
218
=cut
207
=cut
219
208
220
__PACKAGE__->has_many(
209
__PACKAGE__->has_many(
221
  "borrower_attributes",
210
  "borrower_attribute_types_categories",
222
  "Koha::Schema::Result::BorrowerAttribute",
211
  "Koha::Schema::Result::BorrowerAttributeTypesCategory",
223
  { "foreign.code" => "self.code" },
212
  { "foreign.borrower_attribute_type_code" => "self.code" },
224
  { cascade_copy => 0, cascade_delete => 0 },
213
  { cascade_copy => 0, cascade_delete => 0 },
225
);
214
);
226
215
227
=head2 category_code
216
=head2 borrower_attributes
228
217
229
Type: belongs_to
218
Type: has_many
230
219
231
Related object: L<Koha::Schema::Result::Category>
220
Related object: L<Koha::Schema::Result::BorrowerAttribute>
232
221
233
=cut
222
=cut
234
223
235
__PACKAGE__->belongs_to(
224
__PACKAGE__->has_many(
236
  "category_code",
225
  "borrower_attributes",
237
  "Koha::Schema::Result::Category",
226
  "Koha::Schema::Result::BorrowerAttribute",
238
  { categorycode => "category_code" },
227
  { "foreign.code" => "self.code" },
239
  {
228
  { cascade_copy => 0, cascade_delete => 0 },
240
    is_deferrable => 1,
241
    join_type     => "LEFT",
242
    on_delete     => "RESTRICT",
243
    on_update     => "RESTRICT",
244
  },
245
);
229
);
246
230
247
=head2 pseudonymized_borrower_attributes
231
=head2 pseudonymized_borrower_attributes
Lines 259-264 __PACKAGE__->has_many( Link Here
259
  { cascade_copy => 0, cascade_delete => 0 },
243
  { cascade_copy => 0, cascade_delete => 0 },
260
);
244
);
261
245
246
=head2 categorycodes
247
248
Type: many_to_many
249
250
Composing rels: L</borrower_attribute_types_categories> -> categorycode
251
252
=cut
253
254
__PACKAGE__->many_to_many(
255
  "categorycodes",
256
  "borrower_attribute_types_categories",
257
  "categorycode",
258
);
259
262
260
263
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-10 14:00:56
261
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-10 14:00:56
264
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZmiiXHqRGV2SDb4IgSPvJQ
262
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZmiiXHqRGV2SDb4IgSPvJQ
(-)a/Koha/Schema/Result/BorrowerAttributeTypesCategory.pm (+101 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::BorrowerAttributeTypesCategory;
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::BorrowerAttributeTypesCategory
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<borrower_attribute_types_categories>
19
20
=cut
21
22
__PACKAGE__->table("borrower_attribute_types_categories");
23
24
=head1 ACCESSORS
25
26
=head2 borrower_attribute_type_code
27
28
  data_type: 'varchar'
29
  is_foreign_key: 1
30
  is_nullable: 0
31
  size: 10
32
33
=head2 categorycode
34
35
  data_type: 'varchar'
36
  is_foreign_key: 1
37
  is_nullable: 0
38
  size: 10
39
40
=cut
41
42
__PACKAGE__->add_columns(
43
  "borrower_attribute_type_code",
44
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
45
  "categorycode",
46
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
47
);
48
49
=head1 PRIMARY KEY
50
51
=over 4
52
53
=item * L</borrower_attribute_type_code>
54
55
=item * L</categorycode>
56
57
=back
58
59
=cut
60
61
__PACKAGE__->set_primary_key("borrower_attribute_type_code", "categorycode");
62
63
=head1 RELATIONS
64
65
=head2 borrower_attribute_type_code
66
67
Type: belongs_to
68
69
Related object: L<Koha::Schema::Result::BorrowerAttributeType>
70
71
=cut
72
73
__PACKAGE__->belongs_to(
74
  "borrower_attribute_type_code",
75
  "Koha::Schema::Result::BorrowerAttributeType",
76
  { code => "borrower_attribute_type_code" },
77
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
78
);
79
80
=head2 categorycode
81
82
Type: belongs_to
83
84
Related object: L<Koha::Schema::Result::Category>
85
86
=cut
87
88
__PACKAGE__->belongs_to(
89
  "categorycode",
90
  "Koha::Schema::Result::Category",
91
  { categorycode => "categorycode" },
92
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
93
);
94
95
96
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2022-11-03 13:31:18
97
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qDLi69AE+gI/P6b6aeQXcw
98
99
100
# You can replace this text with custom code or comments, and it will be preserved on regeneration
101
1;
(-)a/Koha/Schema/Result/Category.pm (-6 / +19 lines)
Lines 309-326 __PACKAGE__->set_primary_key("categorycode"); Link Here
309
309
310
=head1 RELATIONS
310
=head1 RELATIONS
311
311
312
=head2 borrower_attribute_types
312
=head2 borrower_attribute_types_categories
313
313
314
Type: has_many
314
Type: has_many
315
315
316
Related object: L<Koha::Schema::Result::BorrowerAttributeType>
316
Related object: L<Koha::Schema::Result::BorrowerAttributeTypesCategory>
317
317
318
=cut
318
=cut
319
319
320
__PACKAGE__->has_many(
320
__PACKAGE__->has_many(
321
  "borrower_attribute_types",
321
  "borrower_attribute_types_categories",
322
  "Koha::Schema::Result::BorrowerAttributeType",
322
  "Koha::Schema::Result::BorrowerAttributeTypesCategory",
323
  { "foreign.category_code" => "self.categorycode" },
323
  { "foreign.categorycode" => "self.categorycode" },
324
  { cascade_copy => 0, cascade_delete => 0 },
324
  { cascade_copy => 0, cascade_delete => 0 },
325
);
325
);
326
326
Lines 399-404 __PACKAGE__->has_many( Link Here
399
  { cascade_copy => 0, cascade_delete => 0 },
399
  { cascade_copy => 0, cascade_delete => 0 },
400
);
400
);
401
401
402
=head2 borrower_attribute_type_codes
403
404
Type: many_to_many
405
406
Composing rels: L</borrower_attribute_types_categories> -> borrower_attribute_type_code
407
408
=cut
409
410
__PACKAGE__->many_to_many(
411
  "borrower_attribute_type_codes",
412
  "borrower_attribute_types_categories",
413
  "borrower_attribute_type_code",
414
);
415
402
416
403
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-08 11:06:25
417
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-08 11:06:25
404
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f8BSmD9RKHL/QAvHuuLIyw
418
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f8BSmD9RKHL/QAvHuuLIyw
405
- 

Return to bug 26573