Bugzilla – Attachment 36578 Details for
Bug 13795
Delete unused columns from statistics table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13795: Delete unused columns from stats table
Bug-13795-Delete-unused-columns-from-stats-table.patch (text/plain), 3.09 KB, created by
Nicole C. Engard
on 2015-03-05 13:05:58 UTC
(
hide
)
Description:
Bug 13795: Delete unused columns from stats table
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2015-03-05 13:05:58 UTC
Size:
3.09 KB
patch
obsolete
>From 844611037e5c16ea68bdd0eea5dc78c50b1e37b1 Mon Sep 17 00:00:00 2001 >From: Nicole <nicole@bywatersolutions.com> >Date: Thu, 5 Mar 2015 05:04:34 -0800 >Subject: [PATCH] Bug 13795: Delete unused columns from stats table > >The following 4 fields are never used in the statistics table: > >associatedborrower >other >proccode >usercode > >This patch removes them. > >To test: > >* check the database and make sure columns are gone >--- > installer/data/mysql/kohastructure.sql | 7 ------- > installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ > 2 files changed, 15 insertions(+), 7 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 08ef9ee..2d7bdc1 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/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; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0ed56c6..be6e29f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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) >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13795
:
36578
|
47555
|
86809
|
86810
|
86811
|
88233
|
88234
|
88235
|
88238
|
88239
|
88240