View | Details | Raw Unified | Return to bug 30889
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_30889.pl (-3 / +7 lines)
Lines 2-15 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number => "30889",
4
    bug_number => "30889",
5
    description => "Add context to background_jobs",
5
    description => "Add calling context information to background_jobs",
6
    up => sub {
6
    up => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
9
10
        unless( column_exists( 'background_jobs', 'context') ) {
10
        unless( column_exists( 'background_jobs', 'context') ) {
11
            $dbh->do(q{ ALTER TABLE background_jobs ADD `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `data` });
11
            $dbh->do(q{
12
            say $out "field added";
12
                ALTER TABLE background_jobs
13
                    ADD `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL
14
                    COMMENT 'JSON-serialized context information for the job'
15
                    AFTER `data`
16
            });
13
        }
17
        }
14
    },
18
    },
15
};
19
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 984-990 CREATE TABLE `background_jobs` ( Link Here
984
  `type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
984
  `type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
985
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to',
985
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to',
986
  `data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
986
  `data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
987
  `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
987
  `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'JSON-serialized context information for the job',
988
  `enqueued_on` datetime DEFAULT NULL,
988
  `enqueued_on` datetime DEFAULT NULL,
989
  `started_on` datetime DEFAULT NULL,
989
  `started_on` datetime DEFAULT NULL,
990
  `ended_on` datetime DEFAULT NULL,
990
  `ended_on` datetime DEFAULT NULL,
991
- 

Return to bug 30889