From: Martin Renvoize Date: Mon, 9 Mar 2020 16:41:27 +0000 (+0000) Subject: Bug 17845: Update atomic update for new format X-Git-Tag: v20.05.00~1222 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=c7b7f83ae31c23f1bf7e0e1761d06c733d2817f9;p=srvgit Bug 17845: Update atomic update for new format Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- diff --git a/installer/data/mysql/atomicupdate/bug_17845.perl b/installer/data/mysql/atomicupdate/bug_17845.perl new file mode 100644 index 0000000000..375adc5de3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_17845.perl @@ -0,0 +1,13 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "DROP TABLE IF EXISTS printers" ); + + if( !column_exists( 'branches', 'branchprinter' ) ) { + $dbh->do( "ALTER TABLE branches DROP COLUMN branchprinter" ); + } + + $dbh->do(qq{ DELETE FROM systempreferences WHERE variable = "printcirculationslips"} ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17845 - Drop unused table printers and branchprinter column)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug_17845_remove_printers b/installer/data/mysql/atomicupdate/bug_17845_remove_printers deleted file mode 100644 index 914860be44..0000000000 --- a/installer/data/mysql/atomicupdate/bug_17845_remove_printers +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE IF EXISTS printers; -ALTER TABLE branches DROP COLUMN branchprinter; -DELETE FROM systempreferences WHERE variable = "printcirculationslips"; --- Bug 17845: Drop unused table printers and branchprinter column