Bug 40292: Rename new_record_id if exists

If some installs didn't notice the column was missing (not renamed) we
can still do it now.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a0cc8aa9d7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-10-06 10:30:08 +02:00 committed by Paul Derscheid
parent 9cdf2afc61
commit 2eb0befc36
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "40292",
description => "Rename new_record_id if exists",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( column_exists('additional_field_values', 'new_record_id') ) {
$dbh->do(
q{ ALTER TABLE additional_field_values CHANGE COLUMN new_record_id record_id VARCHAR(11) NOT NULL DEFAULT '' COMMENT 'record_id'; }
);
say_success( $out, "Renamed new_record_id to record_id" );
}
},
};