From 055bb2f0ccab343ae0ad31f1ba5ee69345b32b99 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 2 Jan 2020 13:03:07 +0000 Subject: [PATCH] Bug 24329: Prevent update of timestamp on action_logs updates --- installer/data/mysql/atomicupdate/bug_24329.perl | 8 ++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24329.perl diff --git a/installer/data/mysql/atomicupdate/bug_24329.perl b/installer/data/mysql/atomicupdate/bug_24329.perl new file mode 100644 index 0000000000..3d85aa519d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24329.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE action_logs MODIFY COLUMN `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP" ); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24329 - Do not update action_log.timestamp)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 67495ab962..710ae71768 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2749,7 +2749,7 @@ CREATE TABLE `account_offsets` ( DROP TABLE IF EXISTS `action_logs`; CREATE TABLE `action_logs` ( -- logs of actions taken in Koha (requires that the logs be turned on) `action_id` int(11) NOT NULL auto_increment, -- unique identifier for each action - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time the action took place + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date and time the action took place `user` int(11) NOT NULL default 0, -- the staff member who performed the action (borrowers.borrowernumber) `module` MEDIUMTEXT, -- the module this action was taken against `action` MEDIUMTEXT, -- the action (includes things like DELETED, ADDED, MODIFY, etc) -- 2.20.1