Bug 24151: Add new column borrower_attribute_types.keep_for_pseudonymization
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Nov 2019 13:55:04 +0000 (14:55 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 13:17:42 +0000 (15:17 +0200)
Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha/Schema/Result/BorrowerAttributeType.pm
installer/data/mysql/atomicupdate/bug_24151.perl
installer/data/mysql/kohastructure.sql

index 46a86f0..08048b5 100644 (file)
@@ -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';
 }
index 9a97f80..62fd64d 100644 (file)
@@ -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";
index 7f6b3f1..04bd714 100644 (file)
@@ -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;