Bug 24592: DBRev 19.12.00.021
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 13 Feb 2020 16:00:35 +0000 (16:00 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 13 Feb 2020 16:00:56 +0000 (16:00 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

diff --git a/Koha.pm b/Koha.pm
index 702ee53..2d3dea5 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.020";
+$VERSION = "19.12.00.021";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_24592.perl b/installer/data/mysql/atomicupdate/bug_24592.perl
deleted file mode 100644 (file)
index fcfcc06..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-    # Add LOST_FOUND debit type
-    $dbh->do(qq{
-        INSERT IGNORE INTO
-          account_credit_types ( code, description, can_be_added_manually, is_system )
-        VALUES
-          ('LOST_FOUND', 'Lost item fee refund', 0, 1)
-    });
-
-    # Migrate LOST_RETURN to LOST_FOUND
-    $dbh->do(qq{
-        UPDATE
-          accountlines
-        SET
-          credit_type_code = 'LOST_FOUND'
-        WHERE
-          credit_type_code = 'LOST_RETURN'
-    });
-
-    # Migrate LOST + RETURNED to LOST + FOUND
-    $dbh->do(qq{
-        UPDATE
-          accountlines
-        SET
-          status = 'FOUND'
-        WHERE
-          debit_type_code = 'LOST'
-        AND
-          status = 'RETURNED'
-    });
-
-    # Drop LOST_RETURNED credit type
-    $dbh->do(qq{
-        DELETE FROM account_credit_types WHERE code = 'LOST_RETURN'
-    });
-
-    # Add Lost Item Found offset type
-    $dbh->do(qq{
-        INSERT IGNORE INTO
-          account_offset_types ( type )
-        VALUES
-          ( 'Lost Item Found' )
-    });
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\n";
-}
index 84b3032..9591b9f 100755 (executable)
@@ -20758,6 +20758,56 @@ if ( CheckVersion($DBversion) ) {
     print "Upgrade to $DBversion done (Bug 8643 - Add important constraint to marc subfields)\n";
 }
 
+$DBversion = '19.12.00.021';
+if( CheckVersion( $DBversion ) ) {
+
+    # Add LOST_FOUND debit type
+    $dbh->do(qq{
+        INSERT IGNORE INTO
+          account_credit_types ( code, description, can_be_added_manually, is_system )
+        VALUES
+          ('LOST_FOUND', 'Lost item fee refund', 0, 1)
+    });
+
+    # Migrate LOST_RETURN to LOST_FOUND
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          credit_type_code = 'LOST_FOUND'
+        WHERE
+          credit_type_code = 'LOST_RETURN'
+    });
+
+    # Migrate LOST + RETURNED to LOST + FOUND
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          status = 'FOUND'
+        WHERE
+          debit_type_code = 'LOST'
+        AND
+          status = 'RETURNED'
+    });
+
+    # Drop LOST_RETURNED credit type
+    $dbh->do(qq{
+        DELETE FROM account_credit_types WHERE code = 'LOST_RETURN'
+    });
+
+    # Add Lost Item Found offset type
+    $dbh->do(qq{
+        INSERT IGNORE INTO
+          account_offset_types ( type )
+        VALUES
+          ( 'Lost Item Found' )
+    });
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\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/';