From d6898c13835a971fb0cdda2ffde98d40f6213e1a 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 --- installer/data/mysql/atomicupdate/bug_34843.pl | 18 ++++++++++++++++++ installer/data/mysql/db_revs/210600033.pl | 4 +++- 2 files changed, 21 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 00000000000..8ab22f127c9 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_34843.pl @@ -0,0 +1,18 @@ +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 ec7fb05b4dd..63cad460fa8 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.25.1