From 016aee9aa51abdd999dd26276d58ddc6dda0b46d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 30 Jun 2022 11:52:52 -0300 Subject: [PATCH] Bug 30889: Add comment for the new DB field Signed-off-by: Tomas Cohen Arazi (cherry picked from commit b983e3c505a4ad5c65587c85c4ab79bf3e18eaf3) Signed-off-by: Lucas Gass --- installer/data/mysql/atomicupdate/bug_30889.pl | 10 +++++++--- installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_30889.pl b/installer/data/mysql/atomicupdate/bug_30889.pl index d58a352f9c..5a5141dc51 100755 --- a/installer/data/mysql/atomicupdate/bug_30889.pl +++ b/installer/data/mysql/atomicupdate/bug_30889.pl @@ -2,14 +2,18 @@ use Modern::Perl; return { bug_number => "30889", - description => "Add context to background_jobs", + description => "Add calling context information to background_jobs", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; unless( column_exists( 'background_jobs', 'context') ) { - $dbh->do(q{ ALTER TABLE background_jobs ADD `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `data` }); - say $out "field added"; + $dbh->do(q{ + ALTER TABLE background_jobs + ADD `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL + COMMENT 'JSON-serialized context information for the job' + AFTER `data` + }); } }, }; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2ebbcd846d..8bff19ac48 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -984,7 +984,7 @@ CREATE TABLE `background_jobs` ( `type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to', `data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'JSON-serialized context information for the job', `enqueued_on` datetime DEFAULT NULL, `started_on` datetime DEFAULT NULL, `ended_on` datetime DEFAULT NULL, -- 2.39.5