From 932a6481fd5f0816f0a4eb762416c5f728d89cd0 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 3 Mar 2025 10:07:14 -0100 Subject: [PATCH] Bug 37901: Preparation: [DONT PUSH] automated dbic --- Koha/Schema/Result/BorrowerAttributeType.pm | 19 +------ ...ibute.pm => PseudonymizedMetadataValue.pm} | 52 ++++++++----------- .../Schema/Result/PseudonymizedTransaction.pm | 12 ++--- 3 files changed, 31 insertions(+), 52 deletions(-) rename Koha/Schema/Result/{PseudonymizedBorrowerAttribute.pm => PseudonymizedMetadataValue.pm} (57%) diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm index a83ac83262d..cae827f0547 100644 --- a/Koha/Schema/Result/BorrowerAttributeType.pm +++ b/Koha/Schema/Result/BorrowerAttributeType.pm @@ -254,24 +254,9 @@ __PACKAGE__->belongs_to( }, ); -=head2 pseudonymized_borrower_attributes -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "pseudonymized_borrower_attributes", - "Koha::Schema::Result::PseudonymizedBorrowerAttribute", - { "foreign.code" => "self.code" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-02-20 15:56:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Os1rn9zKu7/rVLVjZM3Mbg +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-02-28 17:05:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qShnFJ7HAiv0BX6lzSQIYA __PACKAGE__->add_columns( '+keep_for_pseudonymization' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/PseudonymizedBorrowerAttribute.pm b/Koha/Schema/Result/PseudonymizedMetadataValue.pm similarity index 57% rename from Koha/Schema/Result/PseudonymizedBorrowerAttribute.pm rename to Koha/Schema/Result/PseudonymizedMetadataValue.pm index aad49c0dbea..cc6dc2002d5 100644 --- a/Koha/Schema/Result/PseudonymizedBorrowerAttribute.pm +++ b/Koha/Schema/Result/PseudonymizedMetadataValue.pm @@ -1,12 +1,12 @@ use utf8; -package Koha::Schema::Result::PseudonymizedBorrowerAttribute; +package Koha::Schema::Result::PseudonymizedMetadataValue; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE =head1 NAME -Koha::Schema::Result::PseudonymizedBorrowerAttribute +Koha::Schema::Result::PseudonymizedMetadataValue =cut @@ -15,11 +15,11 @@ use warnings; use base 'DBIx::Class::Core'; -=head1 TABLE: C +=head1 TABLE: C =cut -__PACKAGE__->table("pseudonymized_borrower_attributes"); +__PACKAGE__->table("pseudonymized_metadata_values"); =head1 ACCESSORS @@ -37,22 +37,29 @@ Row id field is_foreign_key: 1 is_nullable: 0 -=head2 code +=head2 tablename data_type: 'varchar' - is_foreign_key: 1 is_nullable: 0 size: 64 -foreign key from the borrower_attribute_types table, defines which custom field this value was entered for +Name of the related table -=head2 attribute +=head2 key + + data_type: 'varchar' + is_nullable: 0 + size: 64 + +key for the metadata + +=head2 value data_type: 'varchar' is_nullable: 1 size: 255 -custom patron field value +value for the metadata =cut @@ -61,9 +68,11 @@ __PACKAGE__->add_columns( { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "transaction_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "code", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 64 }, - "attribute", + "tablename", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "key", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "value", { data_type => "varchar", is_nullable => 1, size => 255 }, ); @@ -81,21 +90,6 @@ __PACKAGE__->set_primary_key("id"); =head1 RELATIONS -=head2 code - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "code", - "Koha::Schema::Result::BorrowerAttributeType", - { code => "code" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, -); - =head2 transaction Type: belongs_to @@ -112,8 +106,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-10 14:00:56 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:09zbX6WErMxrZSBrc/nvdA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-03-03 12:24:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wh+aP+kaftyf21XYsuMqSg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/PseudonymizedTransaction.pm b/Koha/Schema/Result/PseudonymizedTransaction.pm index de06490fefe..19465d47bfa 100644 --- a/Koha/Schema/Result/PseudonymizedTransaction.pm +++ b/Koha/Schema/Result/PseudonymizedTransaction.pm @@ -235,24 +235,24 @@ __PACKAGE__->set_primary_key("id"); =head1 RELATIONS -=head2 pseudonymized_borrower_attributes +=head2 pseudonymized_metadata_values Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "pseudonymized_borrower_attributes", - "Koha::Schema::Result::PseudonymizedBorrowerAttribute", + "pseudonymized_metadata_values", + "Koha::Schema::Result::PseudonymizedMetadataValue", { "foreign.transaction_id" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-19 14:20:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GVTIlyIi8Vquhf662tDmsQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-03-03 10:52:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A+MN0v0RIN5SCpYOQ991oQ __PACKAGE__->add_columns( '+has_cardnumber' => { is_boolean => 1 }, -- 2.39.5