Bug 21890: DB updates
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 31 Jan 2019 19:25:59 +0000 (16:25 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 12 Apr 2019 02:32:01 +0000 (02:32 +0000)
This patch adds a new column to the categories table:
'reset_password' which is a boolean, and represents, well... that. The
value itself is nullable.

The idea is that OpacResetPassword governs the general behaviour, and
this can be overriden at category-level.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_21890_pwd_reset_by_category.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/bug_21890_pwd_reset_by_category.perl b/installer/data/mysql/atomicupdate/bug_21890_pwd_reset_by_category.perl
new file mode 100644 (file)
index 0000000..b2b6a38
--- /dev/null
@@ -0,0 +1,14 @@
+$DBversion = 'XXX';
+if( CheckVersion( $DBversion ) ) {
+
+    if ( !column_exists( 'categories', 'reset_password' ) ) {
+        $dbh->do(q{
+            ALTER TABLE categories
+                ADD COLUMN reset_password TINYINT(1) NULL DEFAULT NULL
+                AFTER checkprevcheckout
+        });
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21890 - Patron password reset by category)\n";
+}
index 8d7fee9..f11c677 100644 (file)
@@ -318,6 +318,7 @@ 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
   PRIMARY KEY  (`categorycode`),
   UNIQUE KEY `categorycode` (`categorycode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;