From c3b37d4e722b0df846cbd40bd406964115e8a497 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Sep 2021 15:10:20 +0200 Subject: [PATCH] Bug 28534: DBRev 21.06.00.023 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug28534.perl | 23 -------------- installer/data/mysql/db_revs/210600023.pl | 30 +++++++++++++++++++ 3 files changed, 31 insertions(+), 24 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug28534.perl create mode 100755 installer/data/mysql/db_revs/210600023.pl diff --git a/Koha.pm b/Koha.pm index d7a5ddd80d..7847e678a0 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "21.06.00.022"; +$VERSION = "21.06.00.023"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug28534.perl b/installer/data/mysql/atomicupdate/bug28534.perl deleted file mode 100644 index 9733a81494..0000000000 --- a/installer/data/mysql/atomicupdate/bug28534.perl +++ /dev/null @@ -1,23 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - if( !TableExists( 'pending_offline_operations' ) ) { - $dbh->do(q{ - CREATE TABLE `pending_offline_operations` ( - `operationid` int(11) NOT NULL AUTO_INCREMENT, - `userid` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, - `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `action` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, - `barcode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `amount` decimal(28,6) DEFAULT NULL, - PRIMARY KEY (`operationid`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci - }); - } else { - $dbh->do(q{ - ALTER TABLE pending_offline_operations ENGINE = 'InnoDB'; - }); - } - NewVersion( $DBversion, 28534, "Set pending_offline_operations INNoDB rather than MyISAM"); -} diff --git a/installer/data/mysql/db_revs/210600023.pl b/installer/data/mysql/db_revs/210600023.pl new file mode 100755 index 0000000000..66f9e94796 --- /dev/null +++ b/installer/data/mysql/db_revs/210600023.pl @@ -0,0 +1,30 @@ +use Modern::Perl; + +return { + bug_number => "28534", + description => "Set pending_offline_operations INNoDB rather than MyISAM", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + unless( TableExists( 'pending_offline_operations' ) ) { + $dbh->do(q{ + CREATE TABLE `pending_offline_operations` ( + `operationid` int(11) NOT NULL AUTO_INCREMENT, + `userid` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, + `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `action` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `barcode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `amount` decimal(28,6) DEFAULT NULL, + PRIMARY KEY (`operationid`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci + }); + } else { + $dbh->do(q{ + ALTER TABLE pending_offline_operations ENGINE = 'InnoDB'; + }); + } + }, +} -- 2.39.5