Bug 28786: DBRev 21.12.00.036
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 20 Apr 2022 19:14:40 +0000 (09:14 -1000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 21 Apr 2022 06:43:15 +0000 (20:43 -1000)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha.pm
installer/data/mysql/atomicupdate/two-fa.pl [deleted file]
installer/data/mysql/db_revs/211200036.pl [new file with mode: 0755]

diff --git a/Koha.pm b/Koha.pm
index 89b5419..2ba779a 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 = "21.12.00.035";
+$VERSION = "21.12.00.036";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/two-fa.pl b/installer/data/mysql/atomicupdate/two-fa.pl
deleted file mode 100755 (executable)
index 06fd394..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-use Modern::Perl;
-
-return {
-    bug_number => 28786,
-    description => "Add syspref TwoFactorAuthentication, fields secret and auth_method",
-    up => sub {
-        my ($args) = @_;
-        my ($dbh, $out) = @$args{qw(dbh out)};
-
-        $dbh->do(q{
-            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
-            ('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo')
-        });
-
-        if( !column_exists( 'borrowers', 'secret' ) ) {
-          $dbh->do(q{
-              ALTER TABLE borrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
-          });
-        }
-
-        if( !column_exists( 'deletedborrowers', 'secret' ) ) {
-          $dbh->do(q{
-              ALTER TABLE deletedborrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
-            });
-        }
-
-        if( !column_exists( 'borrowers', 'auth_method' ) ) {
-          $dbh->do(q{
-              ALTER TABLE borrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`
-          });
-        }
-
-        if( !column_exists( 'deletedborrowers', 'auth_method' ) ) {
-          $dbh->do(q{
-              ALTER TABLE deletedborrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`
-          });
-        }
-    },
-};
diff --git a/installer/data/mysql/db_revs/211200036.pl b/installer/data/mysql/db_revs/211200036.pl
new file mode 100755 (executable)
index 0000000..06fd394
--- /dev/null
@@ -0,0 +1,39 @@
+use Modern::Perl;
+
+return {
+    bug_number => 28786,
+    description => "Add syspref TwoFactorAuthentication, fields secret and auth_method",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+
+        $dbh->do(q{
+            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+            ('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo')
+        });
+
+        if( !column_exists( 'borrowers', 'secret' ) ) {
+          $dbh->do(q{
+              ALTER TABLE borrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
+          });
+        }
+
+        if( !column_exists( 'deletedborrowers', 'secret' ) ) {
+          $dbh->do(q{
+              ALTER TABLE deletedborrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password`
+            });
+        }
+
+        if( !column_exists( 'borrowers', 'auth_method' ) ) {
+          $dbh->do(q{
+              ALTER TABLE borrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`
+          });
+        }
+
+        if( !column_exists( 'deletedborrowers', 'auth_method' ) ) {
+          $dbh->do(q{
+              ALTER TABLE deletedborrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret`
+          });
+        }
+    },
+};