Bug 30624: DBRev 22.12.00.012
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 13 Mar 2023 18:40:32 +0000 (15:40 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 13 Mar 2023 18:49:36 +0000 (15:49 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha.pm
installer/data/mysql/atomicupdate/bug_30624_add_userflag.pl [deleted file]
installer/data/mysql/db_revs/221200012.pl [new file with mode: 0755]

diff --git a/Koha.pm b/Koha.pm
index af0100c..5c03374 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 = "22.12.00.011";
+$VERSION = "22.12.00.012";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_30624_add_userflag.pl b/installer/data/mysql/atomicupdate/bug_30624_add_userflag.pl
deleted file mode 100755 (executable)
index db13f6c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-use Modern::Perl;
-
-return {
-    bug_number => "30624",
-    description => "Add loggedinlibrary permission",
-    up => sub {
-        my ($args) = @_;
-        my ($dbh, $out) = @$args{qw(dbh out)};
-        $dbh->do(q{
-            INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (29, 'loggedinlibrary', 'Allow staff to change logged in library', 0)
-        });
-
-        my $IndependentBranches = C4::Context->preference('IndependentBranches');
-        unless ( $IndependentBranches ) {
-            $dbh->do(q{
-                UPDATE borrowers SET flags = flags + (1<<29) WHERE ( flags & 4 AND !(flags & 1<<29) ) ;
-           });
-        }
-    },
-};
diff --git a/installer/data/mysql/db_revs/221200012.pl b/installer/data/mysql/db_revs/221200012.pl
new file mode 100755 (executable)
index 0000000..26c3e21
--- /dev/null
@@ -0,0 +1,21 @@
+use Modern::Perl;
+
+return {
+    bug_number => "30624",
+    description => "Add loggedinlibrary permission",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+        $dbh->do(q{
+            INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (29, 'loggedinlibrary', 'Allow staff to change logged in library', 0)
+        });
+        say $out "Added new permission 'loggedinlibrary'";
+
+        my $IndependentBranches = C4::Context->preference('IndependentBranches');
+        unless ( $IndependentBranches ) {
+            $dbh->do(q{
+                UPDATE borrowers SET flags = flags + (1<<29) WHERE ( flags & 4 AND !(flags & 1<<29) ) ;
+           });
+        }
+    },
+};