From 64f22d91bdacffe5d86ca230ceb283b7c0da7325 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Thu, 22 Jul 2021 01:24:08 +0000 Subject: [PATCH] Bug 27945: Add article_request_limit in categories table Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_27945.perl | 15 +++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 16 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_27945.perl diff --git a/installer/data/mysql/atomicupdate/bug_27945.perl b/installer/data/mysql/atomicupdate/bug_27945.perl new file mode 100644 index 0000000000..4a39162019 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27945.perl @@ -0,0 +1,15 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + + # or perform some test and warn + if( !column_exists( 'categories', 'article_request_limit' ) ) { + $dbh->do(q{ + ALTER TABLE `categories` ADD COLUMN `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day' AFTER `article_request_fee` + }); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 27945, "Add article_request_limit to categories table"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index ee26a75837..007fa28a5e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1621,6 +1621,7 @@ CREATE TABLE `categories` ( `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category', `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category', `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority', + `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day', PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.30.2