From 192d6138bdcb2c5f8a2038dd4d399adcafeb3cae Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Thu, 6 Jun 2024 15:12:29 +0200 Subject: [PATCH] Bug 36330: Follow up, change comments in the DB This patch updates the comments of course_items.location and course_items.enabled to say "reserve" instead of "reseve". To test in ktd: - sudo koha-mysql kohadev - Run: "SHOW CREATE TABLE course_items;" - Verify the comments of "location" and "enabled" contains "reseve" instead of "reserve" - Make a note of the definitions of these two columns - Run the atomicupdate: "sudo koha-upgrade-schema kohadev" - Log into the database again and run the same command as above - Verify the comments now say "reserve" instead of "reseve" - Make sure the column definitions are otherwise identical to the ones you saw before the upgrade. Only the spelling of "reserve" in the comment should be changed. Signed-off-by: David Nind Removed unnecessary line of debug output. 2024-06-10 Magnus Enger Signed-off-by: Matt Blenkinsop --- .../atomicupdate/bug36330-fix-typo-reseve.pl | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug36330-fix-typo-reseve.pl diff --git a/installer/data/mysql/atomicupdate/bug36330-fix-typo-reseve.pl b/installer/data/mysql/atomicupdate/bug36330-fix-typo-reseve.pl new file mode 100644 index 0000000000..8bf4690032 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug36330-fix-typo-reseve.pl @@ -0,0 +1,26 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "36330", + description => "Fix typo 'reseve' in COMMENTs for table course_items", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Update columns, only changing the COMMENT + my $affected1 = $dbh->do(q{ ALTER TABLE course_items MODIFY `location` varchar(80) DEFAULT NULL COMMENT 'new shelving location for the item to have while on reserve (optional)' }); + if ( $affected1 ) { + say_success( $out, "Comment for course_items.location was updated." ); + } else { + say_failure( $out, "Comment for course_items.location was not updated." ); + } + my $affected2 = $dbh->do(q{ ALTER TABLE course_items MODIFY `enabled` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'if at least one enabled course has this item on reserve, this field will be ''yes'', otherwise it will be ''no''' }); + if ( $affected2 ) { + say_success( $out, "Comment for course_items.enabled was updated." ); + } else { + say_failure( $out, "Comment for course_items.enabled was not updated." ); + } + + }, +}; -- 2.39.3 (Apple Git-146)