diff --git a/installer/data/mysql/atomicupdate/bug_40292.pl b/installer/data/mysql/atomicupdate/bug_40292.pl new file mode 100755 index 0000000000..e6a7e54bd3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_40292.pl @@ -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" ); + } + }, +};