@@ -, +, @@ --- installer/data/mysql/kohastructure.sql | 7 ------- installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2007,25 +2007,18 @@ DROP TABLE IF EXISTS `statistics`; CREATE TABLE `statistics` ( -- information related to transactions (circulation and fines) in Koha `datetime` datetime default NULL, -- date and time of the transaction `branch` varchar(10) default NULL, -- foreign key, branch where the transaction occurred - `proccode` varchar(4) default NULL, -- proceedure code `value` double(16,4) default NULL, -- monetary value associated with the transaction `type` varchar(16) default NULL, -- transaction type (locause, issue, return, renew, writeoff, payment, Credit*) - `other` mediumtext, - `usercode` varchar(10) default NULL, `itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item `itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower - `associatedborrower` int(11) default NULL, `ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code KEY `timeidx` (`datetime`), KEY `branch_idx` (`branch`), - KEY `proccode_idx` (`proccode`), KEY `type_idx` (`type`), - KEY `usercode_idx` (`usercode`), KEY `itemnumber_idx` (`itemnumber`), KEY `itemtype_idx` (`itemtype`), KEY `borrowernumber_idx` (`borrowernumber`), - KEY `associatedborrower_idx` (`associatedborrower`), KEY `ccode_idx` (`ccode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9793,6 +9793,21 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + ALTER TABLE statistics + DROP COLUMN associatedborrower + DROP COLUMN usercode + DROP COLUMN other + DROP COLUMN proccode + }); + + + print "Upgrade to $DBversion done (Bug 13795 - Delete unused fields from statistics table)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --