From eda9cbe890b5636ea471a3a1d0d3db4bfddbcd75 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 25 Sep 2025 21:24:37 +0000 Subject: [PATCH] Bug 23260: Alter created_on column to not update to current timestamp ON UPDATE --- installer/data/mysql/atomicupdate/bug_23260.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/atomicupdate/bug_23260.pl b/installer/data/mysql/atomicupdate/bug_23260.pl index a59abb272e0..3626a9ae935 100644 --- a/installer/data/mysql/atomicupdate/bug_23260.pl +++ b/installer/data/mysql/atomicupdate/bug_23260.pl @@ -4,11 +4,19 @@ use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "23260", description => - "Make borrowernumber from items_last_borrower nullable, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences", + "Make created_on from items_last_borrower not update to current timestamp ON UPDATE, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; + $dbh->do( + q{ + ALTER TABLE items_last_borrower + MODIFY created_on timestamp NOT NULL DEFAULT current_timestamp() + } + ); + say_success( $out, "Fixed items_last_borrower.created_on column to prevent automatic timestamp updates" ); + $dbh->do( q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -- 2.39.5