From c18573d7a4f591d261acd3ab0f2deba67b6a82a3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 18 Jul 2023 07:00:50 -0400 Subject: [PATCH] Bug 25159: DB Update Signed-off-by: Kyle Hall Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Emmi Takkinen Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- installer/data/mysql/atomicupdate/bug_25159.pl | 13 +++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 14 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_25159.pl diff --git a/installer/data/mysql/atomicupdate/bug_25159.pl b/installer/data/mysql/atomicupdate/bug_25159.pl new file mode 100755 index 0000000000..a2c24e7407 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_25159.pl @@ -0,0 +1,13 @@ +use Modern::Perl; + +return { + bug_number => "251159", + description => "Add action logs should be stored in JSON ( and as a diff of the change )", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ALTER TABLE action_logs ADD COLUMN diff LONGTEXT NULL DEFAULT NULL AFTER trace;}); + say $out "Added column 'action_logs.diff'"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 809400d678..9dd93ecdd3 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -173,6 +173,7 @@ CREATE TABLE `action_logs` ( `interface` varchar(30) DEFAULT NULL COMMENT 'the context this action was taken in', `script` varchar(255) DEFAULT NULL COMMENT 'the name of the cron script that caused this change', `trace` text DEFAULT NULL COMMENT 'An optional stack trace enabled by ActionLogsTraceDepth', + `diff` LONGTEXT NULL DEFAULT NULL COMMENT 'Stores a diff of the changed object', PRIMARY KEY (`action_id`), KEY `timestamp_idx` (`timestamp`), KEY `user_idx` (`user`), -- 2.39.5