Bug 20568: DBRev 17.12.00.043
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 May 2018 19:06:22 +0000 (16:06 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 9 May 2018 15:56:00 +0000 (12:56 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha.pm
installer/data/mysql/atomicupdate/bug_20568_api_keys.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index e7a4bc8..60e80b2 100644 (file)
--- 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.042";
+$VERSION = "17.12.00.043";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_20568_api_keys.perl b/installer/data/mysql/atomicupdate/bug_20568_api_keys.perl
deleted file mode 100644 (file)
index 0267f35..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-$DBversion = "XXX";
-if(CheckVersion($DBversion)) {
-
-    if (!TableExists('api_keys')) {
-        $dbh->do(q{
-            CREATE TABLE `api_keys` (
-                `client_id`   VARCHAR(191) NOT NULL,
-                `secret`      VARCHAR(191) NOT NULL,
-                `description` VARCHAR(255) NOT NULL,
-                `patron_id`   INT(11) NOT NULL,
-                `active`      TINYINT(1) DEFAULT 1 NOT NULL,
-                PRIMARY KEY `client_id` (`client_id`),
-                UNIQUE KEY `secret` (`secret`),
-                KEY `patron_id` (`patron_id`),
-                CONSTRAINT `api_keys_fk_patron_id`
-                  FOREIGN KEY (`patron_id`)
-                  REFERENCES `borrowers` (`borrowernumber`)
-                  ON DELETE CASCADE ON UPDATE CASCADE
-            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-        });
-    }
-
-    print "Upgrade to $DBversion done (Bug 20568 - Add API key management interface for patrons)\n";
-    SetVersion($DBversion);
-}
index 9a7e635..32229b9 100755 (executable)
@@ -16010,6 +16010,32 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 20402 - Implement OAuth2 authentication for REST API)\n";
 }
 
+$DBversion = '17.12.00.043';
+if(CheckVersion($DBversion)) {
+
+    if (!TableExists('api_keys')) {
+        $dbh->do(q{
+            CREATE TABLE `api_keys` (
+                `client_id`   VARCHAR(191) NOT NULL,
+                `secret`      VARCHAR(191) NOT NULL,
+                `description` VARCHAR(255) NOT NULL,
+                `patron_id`   INT(11) NOT NULL,
+                `active`      TINYINT(1) DEFAULT 1 NOT NULL,
+                PRIMARY KEY `client_id` (`client_id`),
+                UNIQUE KEY `secret` (`secret`),
+                KEY `patron_id` (`patron_id`),
+                CONSTRAINT `api_keys_fk_patron_id`
+                  FOREIGN KEY (`patron_id`)
+                  REFERENCES `borrowers` (`borrowernumber`)
+                  ON DELETE CASCADE ON UPDATE CASCADE
+            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+        });
+    }
+
+    print "Upgrade to $DBversion done (Bug 20568 - Add API key management interface for patrons)\n";
+    SetVersion($DBversion);
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.