From 5e512e56b762a3cca13be71a43488c48f3993c35 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 18 Jul 2014 12:54:28 +0200 Subject: [PATCH] Bug 11008: Drop column aqorders.supplierreference It seems that this column has never been used. Test plan: 1/ Execute the updatedatabase entry. 2/ git grep supplierreference should not return occurrence in the code (except in Koha/Schema/* 3/ prove t/db_dependent/Acquisition.t should return green. --- installer/data/mysql/kohastructure.sql | 1 - installer/data/mysql/updatedatabase.pl | 10 ++++++++++ t/db_dependent/Acquisition.t | 3 --- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b46dc6a..a0922ee 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3006,7 +3006,6 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items `datecancellationprinted` date default NULL, -- the date the line item was deleted `order_internalnote` mediumtext, -- notes related to this order line, made for staff `order_vendornote` mediumtext, -- notes related to this order line, made for vendor - `supplierreference` mediumtext, -- not used? always NULL `purchaseordernumber` mediumtext, -- not used? always NULL `basketno` int(11) default NULL, -- links this order line to a specific basket (aqbasket.basketno) `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order line was last modified diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 1030454..118ff8b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8570,6 +8570,16 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + ALTER TABLE aqorders DROP COLUMN supplierreference; + |); + + print "Upgrade to $DBversion done (Bug 11008 - DROP column aqorders.supplierreference)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 837024a..2613e5d 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -365,7 +365,6 @@ my @expectedfields = qw( quantityreceived cancelledby datecancellationprinted - supplierreference purchaseordernumber basketno timestamp @@ -483,7 +482,6 @@ my @base_expectedfields = qw( biblioitemnumber datereceived orderstatus - supplierreference agerestriction budget_branchcode gstrate @@ -603,7 +601,6 @@ ok( creationdate datereceived orderstatus - supplierreference cancelledby isbn copyrightdate -- 2.0.0.rc2