Bug 20256: DBRev 22.12.00.003
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 1 Feb 2023 19:03:39 +0000 (16:03 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Feb 2023 14:59:26 +0000 (11:59 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha.pm
installer/data/mysql/atomicupdate/bug_20256.pl [deleted file]
installer/data/mysql/db_revs/221200003.pl [new file with mode: 0755]

diff --git a/Koha.pm b/Koha.pm
index 6c3cf87..0887f96 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.002";
+$VERSION = "22.12.00.003";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_20256.pl b/installer/data/mysql/atomicupdate/bug_20256.pl
deleted file mode 100755 (executable)
index 2df9e03..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-use Modern::Perl;
-
-return {
-    bug_number  => "20256",
-    description => "Add ability to limit editing of items to home library",
-    up => sub {
-        my ($args) = @_;
-        my ($dbh, $out) = @$args{qw(dbh out)};
-
-        $dbh->do(q{
-            INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_any_item', 'Edit any item reguardless of home library');
-        });
-        say $out "Added new permission 'edit_any_item'";
-
-        $dbh->do(q{
-            INSERT IGNORE INTO user_permissions ( borrowernumber, module_bit, code )
-            SELECT borrowernumber, '9', 'edit_any_item'
-            FROM user_permissions
-            WHERE module_bit = '9'
-            AND code = 'edit_items'
-        });
-
-        if ( !column_exists( 'library_groups', 'ft_limit_item_editing' ) ) {
-            $dbh->do(q{
-                ALTER TABLE library_groups
-                  ADD COLUMN ft_limit_item_editing tinyint(1) NOT NULL DEFAULT 0 AFTER ft_hide_patron_info
-            });
-    
-            say $out "Added column 'library_groups.ft_limit_item_editing'";
-        }
-    },
-};
diff --git a/installer/data/mysql/db_revs/221200003.pl b/installer/data/mysql/db_revs/221200003.pl
new file mode 100755 (executable)
index 0000000..2df9e03
--- /dev/null
@@ -0,0 +1,32 @@
+use Modern::Perl;
+
+return {
+    bug_number  => "20256",
+    description => "Add ability to limit editing of items to home library",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+
+        $dbh->do(q{
+            INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_any_item', 'Edit any item reguardless of home library');
+        });
+        say $out "Added new permission 'edit_any_item'";
+
+        $dbh->do(q{
+            INSERT IGNORE INTO user_permissions ( borrowernumber, module_bit, code )
+            SELECT borrowernumber, '9', 'edit_any_item'
+            FROM user_permissions
+            WHERE module_bit = '9'
+            AND code = 'edit_items'
+        });
+
+        if ( !column_exists( 'library_groups', 'ft_limit_item_editing' ) ) {
+            $dbh->do(q{
+                ALTER TABLE library_groups
+                  ADD COLUMN ft_limit_item_editing tinyint(1) NOT NULL DEFAULT 0 AFTER ft_hide_patron_info
+            });
+    
+            say $out "Added column 'library_groups.ft_limit_item_editing'";
+        }
+    },
+};