Lines 2021-2045
DROP TABLE IF EXISTS `statistics`;
Link Here
|
2021 |
CREATE TABLE `statistics` ( -- information related to transactions (circulation and fines) in Koha |
2021 |
CREATE TABLE `statistics` ( -- information related to transactions (circulation and fines) in Koha |
2022 |
`datetime` datetime default NULL, -- date and time of the transaction |
2022 |
`datetime` datetime default NULL, -- date and time of the transaction |
2023 |
`branch` varchar(10) default NULL, -- foreign key, branch where the transaction occurred |
2023 |
`branch` varchar(10) default NULL, -- foreign key, branch where the transaction occurred |
2024 |
`proccode` varchar(4) default NULL, -- type of procedure used when making payments (does not appear in the code) |
|
|
2025 |
`value` double(16,4) default NULL, -- monetary value associated with the transaction |
2024 |
`value` double(16,4) default NULL, -- monetary value associated with the transaction |
2026 |
`type` varchar(16) default NULL, -- transaction type (locause, issue, return, renew, writeoff, payment, Credit*) |
2025 |
`type` varchar(16) default NULL, -- transaction type (locause, issue, return, renew, writeoff, payment, Credit*) |
2027 |
`other` mediumtext, -- used by SIP |
|
|
2028 |
`usercode` varchar(10) default NULL, -- unused in Koha |
2029 |
`itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item |
2026 |
`itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item |
2030 |
`itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type |
2027 |
`itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type |
2031 |
`borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower |
2028 |
`borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower |
2032 |
`associatedborrower` int(11) default NULL, -- unused in Koha |
|
|
2033 |
`ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code |
2029 |
`ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code |
2034 |
KEY `timeidx` (`datetime`), |
2030 |
KEY `timeidx` (`datetime`), |
2035 |
KEY `branch_idx` (`branch`), |
2031 |
KEY `branch_idx` (`branch`), |
2036 |
KEY `proccode_idx` (`proccode`), |
|
|
2037 |
KEY `type_idx` (`type`), |
2032 |
KEY `type_idx` (`type`), |
2038 |
KEY `usercode_idx` (`usercode`), |
|
|
2039 |
KEY `itemnumber_idx` (`itemnumber`), |
2033 |
KEY `itemnumber_idx` (`itemnumber`), |
2040 |
KEY `itemtype_idx` (`itemtype`), |
2034 |
KEY `itemtype_idx` (`itemtype`), |
2041 |
KEY `borrowernumber_idx` (`borrowernumber`), |
2035 |
KEY `borrowernumber_idx` (`borrowernumber`), |
2042 |
KEY `associatedborrower_idx` (`associatedborrower`), |
|
|
2043 |
KEY `ccode_idx` (`ccode`) |
2036 |
KEY `ccode_idx` (`ccode`) |
2044 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2037 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2045 |
|
2038 |
|