From f809c272af42864b48d2d650ba5ddd0cf03d6b06 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 22 Sep 2023 07:33:57 +0000 Subject: [PATCH] Bug 34843: Fix database comment inconsistency on toc_request Bug 29093 had a dbrev without comment, but added comment to kohastructure. Test plan: Check (or remove) comment on article_requests.toc_request. Run dbrev. Check if comment was added (if you removed). Run t/db/Koha/Database/Commenter.t Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_34843.pl | 17 +++++++++++++++++ installer/data/mysql/db_revs/210600033.pl | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_34843.pl diff --git a/installer/data/mysql/atomicupdate/bug_34843.pl b/installer/data/mysql/atomicupdate/bug_34843.pl new file mode 100755 index 0000000000..b1ce685f13 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_34843.pl @@ -0,0 +1,17 @@ +use Modern::Perl; + +return { + bug_number => 34843, + description => "Restore comment on article_requests.toc_request", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + $dbh->do( + q{ + ALTER TABLE article_requests MODIFY COLUMN toc_request tinyint(4) NOT NULL DEFAULT 0 + COMMENT 'borrower requested table of contents' + AFTER updated_on + } + ); + }, +}; diff --git a/installer/data/mysql/db_revs/210600033.pl b/installer/data/mysql/db_revs/210600033.pl index ec7fb05b4d..63cad460fa 100755 --- a/installer/data/mysql/db_revs/210600033.pl +++ b/installer/data/mysql/db_revs/210600033.pl @@ -8,7 +8,9 @@ return { 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 + ALTER TABLE article_requests ADD COLUMN toc_request tinyint(4) NOT NULL DEFAULT 0 + COMMENT 'borrower requested table of contents' + AFTER updated_on |); } }, -- 2.39.5