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

(-)a/installer/data/mysql/atomicupdate/bug_32330.pl (+25 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "32330",
5
    description => "Add indexes to background_jobs table",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( index_exists('background_jobs', 'borrowernumber') ) {
10
            $dbh->do(q{
11
                ALTER TABLE `background_jobs` ADD INDEX `borrowernumber` (`borrowernumber`)
12
            });
13
        }
14
        unless ( index_exists('background_jobs', 'queue') ) {
15
            $dbh->do(q{
16
                ALTER TABLE `background_jobs` ADD INDEX `queue` (`queue`)
17
            });
18
        }
19
        unless ( index_exists('background_jobs', 'status') ) {
20
            $dbh->do(q{
21
                ALTER TABLE `background_jobs` ADD INDEX `status` (`status`)
22
            });
23
        }
24
    },
25
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +4 lines)
Lines 987-993 CREATE TABLE `background_jobs` ( Link Here
987
  `enqueued_on` datetime DEFAULT NULL,
987
  `enqueued_on` datetime DEFAULT NULL,
988
  `started_on` datetime DEFAULT NULL,
988
  `started_on` datetime DEFAULT NULL,
989
  `ended_on` datetime DEFAULT NULL,
989
  `ended_on` datetime DEFAULT NULL,
990
  PRIMARY KEY (`id`)
990
  PRIMARY KEY (`id`),
991
  KEY `borrowernumber` (`borrowernumber`),
992
  KEY `queue` (`queue`),
993
  KEY `status` (`status`)
991
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
994
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
992
/*!40101 SET character_set_client = @saved_cs_client */;
995
/*!40101 SET character_set_client = @saved_cs_client */;
993
996
994
- 

Return to bug 32330