From 98b4a4929f692bf0950c8e9c9fea9f641daf185d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 19 Sep 2018 16:56:16 +0200 Subject: [PATCH] Bug 21336: Database revision for borrowers.flgAnonymized Content-Type: text/plain; charset=utf-8 This new flag should speak for itself ;) Test plan: Run installer or updatedatabase. Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_21336a.perl | 7 +++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_21336a.perl diff --git a/installer/data/mysql/atomicupdate/bug_21336a.perl b/installer/data/mysql/atomicupdate/bug_21336a.perl new file mode 100644 index 0000000..2ac9f76 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21336a.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE borrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ); + $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21336 - Add field flgAnonymized)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 383ea48..5d92a48 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -625,6 +625,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron `login_attempts` int(4) default 0, -- number of failed login attemps `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token + `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization KEY borrowernumber (borrowernumber), KEY `cardnumber` (`cardnumber`), KEY `sms_provider_id` (`sms_provider_id`) @@ -1656,6 +1657,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron `login_attempts` int(4) default 0, -- number of failed login attemps `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token + `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), -- 2.1.4