# - #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;
+++ /dev/null
-$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);
-}
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.