From 4c9bcd522d9ce7ea4b6071866e2cb1a55c1158b2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 11 Jan 2020 16:56:10 +0100 Subject: [PATCH] Bug 24151: DBIC changes Signed-off-by: Signed-off-by: Sonia Bouis Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/Schema/Result/Branch.pm | 34 +- Koha/Schema/Result/Category.pm | 19 +- .../Schema/Result/PseudonymizedTransaction.pm | 301 ++++++++++++++++++ 3 files changed, 350 insertions(+), 4 deletions(-) create mode 100644 Koha/Schema/Result/PseudonymizedTransaction.pm diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 478c06fc0e..37b2032919 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -683,6 +683,36 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 pseudonymized_transactions_branchcodes + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "pseudonymized_transactions_branchcodes", + "Koha::Schema::Result::PseudonymizedTransaction", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 pseudonymized_transactions_transaction_branchcodes + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "pseudonymized_transactions_transaction_branchcodes", + "Koha::Schema::Result::PseudonymizedTransaction", + { "foreign.transaction_branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 repeatable_holidays Type: has_many @@ -789,8 +819,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-29 16:09:25 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9f0Crr57ffdoe8syXgawng +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2020-06-12 14:01:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hU6Ldf0uN2iV1h7llLH+4g __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 } diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm index cfe788ce6f..16d7a2228c 100644 --- a/Koha/Schema/Result/Category.pm +++ b/Koha/Schema/Result/Category.pm @@ -265,9 +265,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 pseudonymized_transactions -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-04-12 02:43:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7rwTH9HuxcdRCBP/bj0d/A +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "pseudonymized_transactions", + "Koha::Schema::Result::PseudonymizedTransaction", + { "foreign.categorycode" => "self.categorycode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-11 15:54:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mWu3jtWB0NXhGMjoapGfSg sub koha_object_class { 'Koha::Patron::Category'; diff --git a/Koha/Schema/Result/PseudonymizedTransaction.pm b/Koha/Schema/Result/PseudonymizedTransaction.pm new file mode 100644 index 0000000000..61c3b610e7 --- /dev/null +++ b/Koha/Schema/Result/PseudonymizedTransaction.pm @@ -0,0 +1,301 @@ +use utf8; +package Koha::Schema::Result::PseudonymizedTransaction; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::PseudonymizedTransaction + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("pseudonymized_transactions"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 hashed_borrowernumber + + data_type: 'varchar' + is_nullable: 0 + size: 60 + +=head2 has_cardnumber + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 title + + data_type: 'longtext' + is_nullable: 1 + +=head2 city + + data_type: 'longtext' + is_nullable: 1 + +=head2 state + + data_type: 'mediumtext' + is_nullable: 1 + +=head2 zipcode + + data_type: 'varchar' + is_nullable: 1 + size: 25 + +=head2 country + + data_type: 'mediumtext' + is_nullable: 1 + +=head2 branchcode + + data_type: 'varchar' + default_value: (empty string) + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 categorycode + + data_type: 'varchar' + default_value: (empty string) + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 dateenrolled + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 sex + + data_type: 'varchar' + is_nullable: 1 + size: 1 + +=head2 sort1 + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 sort2 + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 datetime + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 transaction_branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 transaction_type + + data_type: 'varchar' + is_nullable: 1 + size: 16 + +=head2 itemnumber + + data_type: 'integer' + is_nullable: 1 + +=head2 itemtype + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +=head2 holdingbranch + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +=head2 location + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 itemcallnumber + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 ccode + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "hashed_borrowernumber", + { data_type => "varchar", is_nullable => 0, size => 60 }, + "has_cardnumber", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "title", + { data_type => "longtext", is_nullable => 1 }, + "city", + { data_type => "longtext", is_nullable => 1 }, + "state", + { data_type => "mediumtext", is_nullable => 1 }, + "zipcode", + { data_type => "varchar", is_nullable => 1, size => 25 }, + "country", + { data_type => "mediumtext", is_nullable => 1 }, + "branchcode", + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, + "categorycode", + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, + "dateenrolled", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "sex", + { data_type => "varchar", is_nullable => 1, size => 1 }, + "sort1", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "sort2", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "datetime", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "transaction_branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "transaction_type", + { data_type => "varchar", is_nullable => 1, size => 16 }, + "itemnumber", + { data_type => "integer", is_nullable => 1 }, + "itemtype", + { data_type => "varchar", is_nullable => 1, size => 10 }, + "holdingbranch", + { data_type => "varchar", is_nullable => 1, size => 10 }, + "location", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "itemcallnumber", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "ccode", + { data_type => "varchar", is_nullable => 1, size => 80 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, +); + +=head2 categorycode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "categorycode", + "Koha::Schema::Result::Category", + { categorycode => "categorycode" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, +); + +=head2 transaction_branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "transaction_branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "transaction_branchcode" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-11 16:08:51 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r3YdoQ6TKEF0THmeXHvRwA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5