Bug 17845: Remove the column if it exists

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-03-10 10:56:08 +01:00 committed by Martin Renvoize
parent 07b0c5bc0e
commit b0a783a8a8
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -2,8 +2,8 @@ $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" );
if( column_exists( 'branches', 'branchprinter' ) ) {
$dbh->do( "ALTER TABLE branches DROP COLUMN branchprinter" );
}
$dbh->do(qq{ DELETE FROM systempreferences WHERE variable = "printcirculationslips"} );