Bugzilla – Attachment 13576 Details for
Bug 9064
statistics.ccode specified inconsistently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9064: fix statistics.ccode column
Bug-9064-fix-statisticsccode-column.patch (text/plain), 2.54 KB, created by
Kyle M Hall (khall)
on 2012-11-21 13:21:56 UTC
(
hide
)
Description:
Bug 9064: fix statistics.ccode column
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-11-21 13:21:56 UTC
Size:
2.54 KB
patch
obsolete
>From 247ad5c04f242609951a6fc11ded020b636ba540 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 21 Nov 2012 13:46:59 +0100 >Subject: [PATCH] Bug 9064: fix statistics.ccode column >Content-Type: text/plain; charset="utf-8" > >From updatedatabase.pl: > $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower"); >From kohastructure.sql: > `ccode` int(11) default NULL, -- foreign key from the items table, links transaction to a specific collection code > >The variant in updatedatabase.pl is probably what was wanted. > >This patch fixes the kohastructure and add another updatedatabase.pl, in case someone has a broken install. >This should not happen, because 3.10.0 still not released, but just in case... > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c0d9936..cc9fb21 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1850,7 +1850,7 @@ CREATE TABLE `statistics` ( -- information related to transactions (circulation > `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` int(11) default NULL, -- foreign key from the items table, links transaction to a specific collection code >+ `ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code > KEY `timeidx` (`datetime`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 964df0c..31bfc88 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6062,6 +6062,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.09.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("ALTER TABLE statistics CHANGE COLUMN ccode ccode varchar(10) NULL"); >+ print "Upgrade to $DBversion done (Bug 9064: statistics.ccode potentially wrongly defined)\n"; >+ SetVersion ($DBversion); >+} >+ > > =head1 FUNCTIONS > >-- >1.7.2.5
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 9064
:
13575
| 13576