From 646afec722bd438089d0b33a1a531d2e8ea260d6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 17 Mar 2020 09:50:18 +0100 Subject: [PATCH] Bug 18177: DB changes --- installer/data/mysql/atomicupdate/bug_18177.perl | 15 +++++++++++++++ installer/data/mysql/kohastructure.sql | 7 +------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_18177.perl diff --git a/installer/data/mysql/atomicupdate/bug_18177.perl b/installer/data/mysql/atomicupdate/bug_18177.perl new file mode 100644 index 0000000000..0426fda963 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18177.perl @@ -0,0 +1,15 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + for my $column ( qw(othersupplier booksellerfax booksellerurl bookselleremail currency) ) { + if( column_exists( 'aqbooksellers', $column ) ) { + $dbh->do(qq| + ALTER TABLE aqbooksellers + DROP COLUMN $column + |); + } + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18177 - Remove some unused columns from aqbooksellers)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0f092725b5..e3d0d09760 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2764,13 +2764,8 @@ CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis `address3` LONGTEXT, -- third line of vendor physical address `address4` LONGTEXT, -- fourth line of vendor physical address `phone` varchar(30) default NULL, -- vendor phone number - `accountnumber` LONGTEXT, -- unused in Koha - `othersupplier` LONGTEXT, -- unused in Koha - `currency` varchar(10) NOT NULL default '', -- unused in Koha - `booksellerfax` LONGTEXT, -- vendor fax number + `accountnumber` LONGTEXT, -- vendor account number `notes` LONGTEXT, -- order notes - `bookselleremail` LONGTEXT, -- vendor email - `booksellerurl` LONGTEXT, -- unused in Koha `postal` LONGTEXT, -- vendor postal address (all lines) `url` varchar(255) default NULL, -- vendor web address `active` tinyint(4) default NULL, -- is this vendor active (1 for yes, 0 for no) -- 2.20.1