From 897442fbac80386c09dd137a00b7878ed8f155f8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 20 Feb 2019 13:18:00 -0300 Subject: [PATCH] Bug 10796: DB update --- .../bug_10796_pwd_change_by_category.perl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_10796_pwd_change_by_category.perl diff --git a/installer/data/mysql/atomicupdate/bug_10796_pwd_change_by_category.perl b/installer/data/mysql/atomicupdate/bug_10796_pwd_change_by_category.perl new file mode 100644 index 0000000000..83fec3deb6 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_10796_pwd_change_by_category.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + + if ( !column_exists( 'categories', 'change_password' ) ) { + $dbh->do(q{ + ALTER TABLE categories + ADD COLUMN change_password TINYINT(1) NULL DEFAULT NULL + AFTER reset_password + }); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 10796 - Patron password change by category)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 631fe0364f..692d5befc8 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -318,7 +318,8 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'. - `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow + `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow, + `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.20.1