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>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
`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;
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