From 6ce7ce3b7644635d936ba421021cb24deae53ae3 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 23 Sep 2021 12:30:31 +0000 Subject: [PATCH] Bug 29093: Database revision for article_requests.toc_request Content-Type: text/plain; charset=utf-8 Test plan: Run dbrev or new install. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind Signed-off-by: Nick Clemens --- installer/data/mysql/atomicupdate/bug_29093.pl | 15 +++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 16 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_29093.pl diff --git a/installer/data/mysql/atomicupdate/bug_29093.pl b/installer/data/mysql/atomicupdate/bug_29093.pl new file mode 100755 index 0000000000..ec7fb05b4d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29093.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "29093", + description => "Add column article_requests.toc_request", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !column_exists('article_requests', 'toc_request') ) { + $dbh->do( q| + ALTER TABLE article_requests ADD COLUMN toc_request tinyint(4) NOT NULL DEFAULT 0 AFTER updated_on + |); + } + }, +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0976ece489..6680a41003 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -756,6 +756,7 @@ CREATE TABLE `article_requests` ( `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION', `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL', `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `toc_request` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'borrower requested table of contents', PRIMARY KEY (`id`), KEY `borrowernumber` (`borrowernumber`), KEY `biblionumber` (`biblionumber`), -- 2.20.1