Bug 13142: DBRev 21.12.00.055
[koha.git] / installer / data / mysql / db_revs / 210600023.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "28534",
5     description => "Set pending_offline_operations INNoDB rather than MyISAM",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9
10         unless( TableExists( 'pending_offline_operations' ) ) {
11             $dbh->do(q{
12                 CREATE TABLE `pending_offline_operations` (
13                 `operationid` int(11) NOT NULL AUTO_INCREMENT,
14                 `userid` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
15                 `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
16                 `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
17                 `action` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
18                 `barcode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
19                 `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
20                 `amount` decimal(28,6) DEFAULT NULL,
21                 PRIMARY KEY (`operationid`)
22                 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
23             });
24         } else {
25             $dbh->do(q{
26                 ALTER TABLE pending_offline_operations ENGINE = 'InnoDB';
27             });
28         }
29     },
30 }