View | Details | Raw Unified | Return to bug 13795
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-7 lines)
Lines 2007-2031 DROP TABLE IF EXISTS `statistics`; Link Here
2007
CREATE TABLE `statistics` ( -- information related to transactions (circulation and fines) in Koha
2007
CREATE TABLE `statistics` ( -- information related to transactions (circulation and fines) in Koha
2008
  `datetime` datetime default NULL, -- date and time of the transaction
2008
  `datetime` datetime default NULL, -- date and time of the transaction
2009
  `branch` varchar(10) default NULL, -- foreign key, branch where the transaction occurred
2009
  `branch` varchar(10) default NULL, -- foreign key, branch where the transaction occurred
2010
  `proccode` varchar(4) default NULL, -- proceedure code 
2011
  `value` double(16,4) default NULL, -- monetary value associated with the transaction
2010
  `value` double(16,4) default NULL, -- monetary value associated with the transaction
2012
  `type` varchar(16) default NULL, -- transaction type (locause, issue, return, renew, writeoff, payment, Credit*)
2011
  `type` varchar(16) default NULL, -- transaction type (locause, issue, return, renew, writeoff, payment, Credit*)
2013
  `other` mediumtext,
2014
  `usercode` varchar(10) default NULL,
2015
  `itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item
2012
  `itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item
2016
  `itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type
2013
  `itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type
2017
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower
2014
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower
2018
  `associatedborrower` int(11) default NULL,
2019
  `ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code
2015
  `ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code
2020
  KEY `timeidx` (`datetime`),
2016
  KEY `timeidx` (`datetime`),
2021
  KEY `branch_idx` (`branch`),
2017
  KEY `branch_idx` (`branch`),
2022
  KEY `proccode_idx` (`proccode`),
2023
  KEY `type_idx` (`type`),
2018
  KEY `type_idx` (`type`),
2024
  KEY `usercode_idx` (`usercode`),
2025
  KEY `itemnumber_idx` (`itemnumber`),
2019
  KEY `itemnumber_idx` (`itemnumber`),
2026
  KEY `itemtype_idx` (`itemtype`),
2020
  KEY `itemtype_idx` (`itemtype`),
2027
  KEY `borrowernumber_idx` (`borrowernumber`),
2021
  KEY `borrowernumber_idx` (`borrowernumber`),
2028
  KEY `associatedborrower_idx` (`associatedborrower`),
2029
  KEY `ccode_idx` (`ccode`)
2022
  KEY `ccode_idx` (`ccode`)
2030
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2023
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2031
2024
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +15 lines)
Lines 9793-9798 if(CheckVersion($DBversion)) { Link Here
9793
    SetVersion($DBversion);
9793
    SetVersion($DBversion);
9794
}
9794
}
9795
9795
9796
$DBversion = "3.19.00.XXX";
9797
if(CheckVersion($DBversion)) {
9798
    $dbh->do(q{
9799
        ALTER TABLE statistics 
9800
         DROP COLUMN associatedborrower
9801
         DROP COLUMN usercode
9802
         DROP COLUMN other
9803
         DROP COLUMN proccode
9804
    });
9805
9806
9807
    print "Upgrade to $DBversion done (Bug 13795 - Delete unused fields from statistics table)\n";
9808
    SetVersion($DBversion);
9809
}
9810
9796
=head1 FUNCTIONS
9811
=head1 FUNCTIONS
9797
9812
9798
=head2 TableExists($table)
9813
=head2 TableExists($table)
9799
- 

Return to bug 13795