Bug 38436: Rename columns_settings.columnname in DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-11-15 15:28:08 +01:00 committed by Katrin Fischer
parent 42df19b3e1
commit 4e12775e4f
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "38436",
description => "Adjust column names for holdings tables",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
say $dbh->do(q{
UPDATE columns_settings
SET columnname = REGEXP_REPLACE(columnname, '.*holdings_', '')
WHERE module="catalogue" AND page="detail" AND ( tablename="holdings_table" OR tablename="otherholdings_table")
});
say_success( $out, "Column names renamed" );
},
};