Bugzilla – Attachment 105802 Details for
Bug 24151
Add a pseudonymization process for patrons and transactions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24151: DBIC changes
Bug-24151-DBIC-changes.patch (text/plain), 8.83 KB, created by
Jonathan Druart
on 2020-06-12 14:05:01 UTC
(
hide
)
Description:
Bug 24151: DBIC changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-06-12 14:05:01 UTC
Size:
8.83 KB
patch
obsolete
>From 48b886c57645e5f2d797c7786de216bb18ab424c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 11 Jan 2020 16:56:10 +0100 >Subject: [PATCH] Bug 24151: DBIC changes > >Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> >--- > 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<Koha::Schema::Result::PseudonymizedTransaction> >+ >+=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<Koha::Schema::Result::PseudonymizedTransaction> >+ >+=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<Koha::Schema::Result::PseudonymizedTransaction> >+ >+=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<pseudonymized_transactions> >+ >+=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</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 RELATIONS >+ >+=head2 branchcode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Branch> >+ >+=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<Koha::Schema::Result::Category> >+ >+=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<Koha::Schema::Result::Branch> >+ >+=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.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24151
:
95959
|
95960
|
95961
|
95962
|
95963
|
95964
|
95965
|
95966
|
95967
|
95968
|
95969
|
95970
|
95971
|
95972
|
95973
|
95974
|
95975
|
95976
|
97240
|
97241
|
97242
|
97243
|
97244
|
97245
|
97246
|
97247
|
97248
|
97249
|
97250
|
97251
|
97252
|
101034
|
101035
|
101036
|
101037
|
101038
|
101039
|
101040
|
101041
|
101042
|
101043
|
101044
|
101045
|
101046
|
101047
|
101048
|
101049
|
105801
|
105802
|
105803
|
105804
|
105805
|
105806
|
105807
|
105808
|
105809
|
105810
|
105811
|
105812
|
105813
|
105814
|
105815
|
105816
|
106032
|
106033
|
106034
|
106035
|
106036
|
106037
|
106038
|
106039
|
106040
|
106041
|
106042
|
106043
|
106044
|
106045
|
106046
|
106047
|
106048
|
106049
|
106195
|
106255
|
107127
|
107225