Bug 18936: DBRev 19.12.00.018
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 4 Feb 2020 10:08:50 +0000 (10:08 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 4 Feb 2020 10:09:18 +0000 (10:09 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha.pm
installer/data/mysql/atomicupdate/bug_18936.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 31613b5..c27e959 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.017";
+$VERSION = "19.12.00.018";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_18936.perl b/installer/data/mysql/atomicupdate/bug_18936.perl
deleted file mode 100644 (file)
index 160c5b1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    my @columns = qw(
-        restrictedtype
-        rentaldiscount
-        fine
-        finedays
-        maxsuspensiondays
-        suspension_chargeperiod
-        firstremind
-        chargeperiod
-        chargeperiod_charge_at
-        accountsent
-        issuelength
-        lengthunit
-        hardduedate
-        hardduedatecompare
-        renewalsallowed
-        renewalperiod
-        norenewalbefore
-        auto_renew
-        no_auto_renewal_after
-        no_auto_renewal_after_hard_limit
-        reservesallowed
-        holds_per_record
-        holds_per_day
-        onshelfholds
-        opacitemholds
-        overduefinescap
-        cap_fine_to_replacement_price
-        article_requests
-        note
-    );
-
-    if ( column_exists( 'issuingrules', 'categorycode' ) ) {
-        foreach my $column ( @columns ) {
-            $dbh->do("
-                INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
-                SELECT IF(categorycode='*', NULL, categorycode), IF(branchcode='*', NULL, branchcode), IF(itemtype='*', NULL, itemtype), \'$column\', COALESCE( $column, '' )
-                FROM issuingrules
-            ");
-        }
-        $dbh->do("DROP TABLE issuingrules");
-    }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 18936: Convert issuingrules fields to circulation_rules)\n";
-}
index 65c9b18..3f17b16 100755 (executable)
@@ -20683,6 +20683,55 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 21674 - Add unique key (parent_id, branchcode) to library_group)\n";
 }
 
+$DBversion = '19.12.00.018';
+if( CheckVersion( $DBversion ) ) {
+    my @columns = qw(
+        restrictedtype
+        rentaldiscount
+        fine
+        finedays
+        maxsuspensiondays
+        suspension_chargeperiod
+        firstremind
+        chargeperiod
+        chargeperiod_charge_at
+        accountsent
+        issuelength
+        lengthunit
+        hardduedate
+        hardduedatecompare
+        renewalsallowed
+        renewalperiod
+        norenewalbefore
+        auto_renew
+        no_auto_renewal_after
+        no_auto_renewal_after_hard_limit
+        reservesallowed
+        holds_per_record
+        holds_per_day
+        onshelfholds
+        opacitemholds
+        overduefinescap
+        cap_fine_to_replacement_price
+        article_requests
+        note
+    );
+
+    if ( column_exists( 'issuingrules', 'categorycode' ) ) {
+        foreach my $column ( @columns ) {
+            $dbh->do("
+                INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+                SELECT IF(categorycode='*', NULL, categorycode), IF(branchcode='*', NULL, branchcode), IF(itemtype='*', NULL, itemtype), \'$column\', COALESCE( $column, '' )
+                FROM issuingrules
+            ");
+        }
+        $dbh->do("DROP TABLE issuingrules");
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 18936: Convert issuingrules fields to circulation_rules)\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/';