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 |
|