From f4366deb73f31b0e28e302d8c0d69c69dca79274 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 9 Mar 2020 16:41:27 +0000 Subject: [PATCH] Bug 17845: Update atomic update for new format Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_17845.perl | 13 +++++++++++++ .../mysql/atomicupdate/bug_17845_remove_printers | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_17845.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_17845_remove_printers diff --git a/installer/data/mysql/atomicupdate/bug_17845.perl b/installer/data/mysql/atomicupdate/bug_17845.perl new file mode 100644 index 0000000000..a70505df37 --- /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 -- 2.20.1