Bug 22435: Improve database update
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 14 May 2021 15:42:44 +0000 (16:42 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Aug 2021 12:06:43 +0000 (14:06 +0200)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_22435.perl

index 1b14a09..d7dbbdd 100644 (file)
@@ -2,6 +2,7 @@ $DBversion = 'XXX'; # will be replaced by the RM
 if( CheckVersion( $DBversion ) ) {
     $dbh->do( "INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'CREATE' ), ( 'APPLY' )" );
     $dbh->do( "UPDATE account_offsets SET type = 'CREATE' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND ( debit_id IS NULL OR credit_id IS NULL)" );
+    $dbh->do( "UPDATE account_offsets SET type = 'APPLY' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND type != 'CREATE'" );
 
     NewVersion( $DBversion, 22435, "Update offsets to CREATE type");
 }