Bug 39526: Prevent other prefs to be renamed

There is only one pref. It feel safer to rename this specific pref than
other pref that might not be ES related.

Other prefs starting with "ES" could be added, then this patch
backported, etc.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-09-16 16:36:01 +02:00 committed by Lucas Gass
parent c4a6c7584d
commit 8dbf22f996
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 3 additions and 5 deletions

View File

@ -8,11 +8,9 @@ return {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
$dbh->do(
q{update systempreferences set variable = REGEXP_REPLACE(variable, '^ES', 'Elasticsearch') where variable like 'ES%'}
);
say $out "Renamed system preference 'ES..' to 'Elasticsearch..'";
q{UPDATE systempreferences SET variable = 'ElasticsearchPreventAutoTruncate' WHERE variable = 'ESPreventAutoTruncate'}
) == 1
&& say $out "Renamed system preference 'ESPreventAutoTruncate' to 'ElasticsearchPreventAutoTruncate'";
},
};