From 2e08fa0b1877a2c0d68ff98f7713cac697e99c41 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Oct 2020 13:27:52 +0000 Subject: [PATCH] Bug 15032: DBRev 20.06.00.045 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_15032.perl | 31 ------------------- installer/data/mysql/updatedatabase.pl | 30 ++++++++++++++++++ 3 files changed, 31 insertions(+), 32 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_15032.perl diff --git a/Koha.pm b/Koha.pm index c9b43e5aa3..9fdccf002a 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 = "20.06.00.044"; +$VERSION = "20.06.00.045"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_15032.perl b/installer/data/mysql/atomicupdate/bug_15032.perl deleted file mode 100644 index 1c7eec4dbb..0000000000 --- a/installer/data/mysql/atomicupdate/bug_15032.perl +++ /dev/null @@ -1,31 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); - - unless ( TableExists('background_jobs') ) { - $dbh->do(q| - CREATE TABLE background_jobs ( - id INT(11) NOT NULL AUTO_INCREMENT, - status VARCHAR(32), - progress INT(11), - size INT(11), - borrowernumber INT(11), - type VARCHAR(64), - data TEXT, - enqueued_on DATETIME DEFAULT NULL, - started_on DATETIME DEFAULT NULL, - ended_on DATETIME DEFAULT NULL, - PRIMARY KEY (id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - |); - } - - $dbh->do(qq{ - INSERT IGNORE permissions (module_bit, code, description) - VALUES - (3, 'manage_background_jobs', 'Manage background jobs') - }); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 15032 - Add new table background_jobs)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 39847fd9b2..146a38c9f4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -22923,6 +22923,36 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 22343, "Add SMTP configuration options"); } +$DBversion = '20.06.00.045'; +if( CheckVersion( $DBversion ) ) { + + unless ( TableExists('background_jobs') ) { + $dbh->do(q| + CREATE TABLE background_jobs ( + id INT(11) NOT NULL AUTO_INCREMENT, + status VARCHAR(32), + progress INT(11), + size INT(11), + borrowernumber INT(11), + type VARCHAR(64), + data TEXT, + enqueued_on DATETIME DEFAULT NULL, + started_on DATETIME DEFAULT NULL, + ended_on DATETIME DEFAULT NULL, + PRIMARY KEY (id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + |); + } + + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (3, 'manage_background_jobs', 'Manage background jobs') + }); + + NewVersion( $DBversion, 15032, "Add new table background_jobs"); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5