From d012552ab636b23227990e3992e9dfe34733fcab Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 May 2018 16:05:04 -0300 Subject: [PATCH] Bug 20402: DBRev 17.12.00.042 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/oauth_tokens.perl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/oauth_tokens.perl diff --git a/Koha.pm b/Koha.pm index 644fe26d69..e7a4bc890a 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 = "17.12.00.041"; +$VERSION = "17.12.00.042"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/oauth_tokens.perl b/installer/data/mysql/atomicupdate/oauth_tokens.perl deleted file mode 100644 index 070aed2573..0000000000 --- a/installer/data/mysql/atomicupdate/oauth_tokens.perl +++ /dev/null @@ -1,17 +0,0 @@ -$DBversion = 'XXX'; -if (CheckVersion($DBversion)) { - - if (!TableExists('oauth_access_tokens')) { - $dbh->do(q{ - CREATE TABLE oauth_access_tokens ( - `access_token` VARCHAR(191) NOT NULL, - `client_id` VARCHAR(191) NOT NULL, - `expires` INT NOT NULL, - PRIMARY KEY (`access_token`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci - }); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 20402 - Implement OAuth2 authentication for REST API)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 880b500e98..9a7e635e20 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15992,6 +15992,24 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 11317 - Add a new permission to access files stored on the server)\n"; } +$DBversion = '17.12.00.042'; +if( CheckVersion( $DBversion ) ) { + + if (!TableExists('oauth_access_tokens')) { + $dbh->do(q{ + CREATE TABLE oauth_access_tokens ( + `access_token` VARCHAR(191) NOT NULL, + `client_id` VARCHAR(191) NOT NULL, + `expires` INT NOT NULL, + PRIMARY KEY (`access_token`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci + }); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20402 - Implement OAuth2 authentication for REST API)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5