From 25930f79dcd814c923d5c6948720ed7b75579062 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Nov 2019 14:55:04 +0100 Subject: [PATCH] Bug 24151: Add new column borrower_attribute_types.keep_for_pseudonymization Sponsored-by: Association KohaLa - https://koha-fr.org/ Signed-off-by: Signed-off-by: Sonia Bouis Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/Schema/Result/BorrowerAttributeType.pm | 4 ++++ installer/data/mysql/atomicupdate/bug_24151.perl | 6 ++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 11 insertions(+) diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm index 46a86f07bc..08048b51d4 100644 --- a/Koha/Schema/Result/BorrowerAttributeType.pm +++ b/Koha/Schema/Result/BorrowerAttributeType.pm @@ -165,6 +165,10 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-25 20:32:12 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gsPR8PuUUZHFUkr3MIbTpw +__PACKAGE__->add_columns( + '+keep_for_pseudonymization' => { is_boolean => 1 }, +); + sub koha_object_class { 'Koha::Patron::Attribute::Type'; } diff --git a/installer/data/mysql/atomicupdate/bug_24151.perl b/installer/data/mysql/atomicupdate/bug_24151.perl index 9a97f808b7..62fd64db9e 100644 --- a/installer/data/mysql/atomicupdate/bug_24151.perl +++ b/installer/data/mysql/atomicupdate/bug_24151.perl @@ -60,6 +60,12 @@ if( CheckVersion( $DBversion ) ) { |); } + unless( column_exists('borrower_attribute_types', 'keep_for_pseudonymization') ) { + $dbh->do(q| + ALTER TABLE borrower_attribute_types ADD COLUMN `keep_for_pseudonymization` TINYINT(1) NOT NULL DEFAULT 0 AFTER `class` + |); + } + # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 24151 - Add pseudonymized_transactions tables and sysprefs for Pseudonymization)\n"; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 7f6b3f1f14..04bd714648 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -228,6 +228,7 @@ CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens `category_code` VARCHAR(10) NULL DEFAULT NULL,-- defines a category for an attribute_type `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type + `keep_for_pseudonymization` tinyint(1) NOT NULL default 0, -- defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no) PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.39.5