Bug 23355: DBRev 19.12.00.033
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 3 Mar 2020 15:01:48 +0000 (15:01 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 3 Mar 2020 15:03:02 +0000 (15:03 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha.pm
installer/data/mysql/atomicupdate/bug_23355.perl [deleted file]
installer/data/mysql/atomicupdate/bug_23355_permissions.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index ea08722..6951014 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 = "19.12.00.032";
+$VERSION = "19.12.00.033";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_23355.perl b/installer/data/mysql/atomicupdate/bug_23355.perl
deleted file mode 100644 (file)
index 72bca27..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$DBversion = 'XXX';    # will be replaced by the RM
-if ( CheckVersion($DBversion) ) {
-
-    $dbh->do(qq{
-        CREATE TABLE  IF NOT EXISTS `cash_register_actions` (
-          `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register action
-          `code` varchar(24) NOT NULL, -- action code denoting the type of action recorded (enum),
-          `register_id` int(11) NOT NULL, -- id of cash_register this action belongs to,
-          `manager_id` int(11) NOT NULL, -- staff member performing the action
-          `amount` decimal(28,6) DEFAULT NULL, -- amount recorded in action (signed)
-          `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-          PRIMARY KEY (`id`),
-          CONSTRAINT `cash_register_actions_manager` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
-          CONSTRAINT `cash_register_actions_register` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-        ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
-    });
-
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 23355 - Add cash_register_actions table)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_23355_permissions.perl b/installer/data/mysql/atomicupdate/bug_23355_permissions.perl
deleted file mode 100644 (file)
index 15251c0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-$DBversion = 'XXX';    # will be replaced by the RM
-if ( CheckVersion($DBversion) ) {
-
-    $dbh->do(qq{
-        INSERT IGNORE permissions (module_bit, code, description)
-        VALUES
-        (25, 'cashup', 'Perform cash register cashup action')
-    });
-
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 23355 - Add cash register cashup permissions)\n";
-}
index df89536..3688bc7 100755 (executable)
@@ -20975,6 +20975,36 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 24735 - Remove UseQueryParser system preference)\n";
 }
 
+$DBversion = '19.12.00.033';
+if ( CheckVersion($DBversion) ) {
+
+    # Add cash_register_actions table
+    $dbh->do(qq{
+        CREATE TABLE  IF NOT EXISTS `cash_register_actions` (
+          `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register action
+          `code` varchar(24) NOT NULL, -- action code denoting the type of action recorded (enum),
+          `register_id` int(11) NOT NULL, -- id of cash_register this action belongs to,
+          `manager_id` int(11) NOT NULL, -- staff member performing the action
+          `amount` decimal(28,6) DEFAULT NULL, -- amount recorded in action (signed)
+          `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+          PRIMARY KEY (`id`),
+          CONSTRAINT `cash_register_actions_manager` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+          CONSTRAINT `cash_register_actions_register` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+        ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
+    });
+
+    # Add cashup permission
+    $dbh->do(qq{
+        INSERT IGNORE permissions (module_bit, code, description)
+        VALUES
+        (25, 'cashup', 'Perform cash register cashup action')
+    });
+
+    SetVersion($DBversion);
+    print "Upgrade to $DBversion done (Bug 23355 - Add cash_register_actions table)\n";
+    print "Upgrade to $DBversion done (Bug 23355 - Add cash register cashup permissions)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
 my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';