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

(-)a/Koha/Schema/Result/BorrowerAttributeType.pm (-31 / +29 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-267 __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 @ 2025-02-06 10:47:55
264
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZmiiXHqRGV2SDb4IgSPvJQ
262
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jKC65zPRBCm2nn+tCW+FXg
265
263
266
__PACKAGE__->add_columns(
264
__PACKAGE__->add_columns(
267
    '+keep_for_pseudonymization' => { is_boolean => 1 },
265
    '+keep_for_pseudonymization' => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Category.pm (-8 / +21 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-407 __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 @ 2025-02-06 10:47:55
404
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f8BSmD9RKHL/QAvHuuLIyw
418
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:icPxRfjay5klakPb9qIoTA
405
419
406
# You can replace this text with custom code or comments, and it will be preserved on regeneration
420
# You can replace this text with custom code or comments, and it will be preserved on regeneration
407
421
408
- 

Return to bug 26573