Skip to content

Commit

Permalink
kohabug 2934 - Wrong datatype causes artificial limit to label batch …
Browse files Browse the repository at this point in the history
…id's

labels.batch_id should be int as the value is always an integer. This corrects
the problem.

[RM note: ported patch to HEAD.  DB rev 024]

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
  • Loading branch information
cnighswonger authored and Galen Charlton committed Apr 24, 2009
1 parent 34d3399 commit cd16f12
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion installer/data/mysql/kohastructure.sql
Expand Up @@ -1222,7 +1222,7 @@ CREATE TABLE `itemtypes` (
DROP TABLE IF EXISTS `labels`;
CREATE TABLE `labels` (
`labelid` int(11) NOT NULL auto_increment,
`batch_id` varchar(10) NOT NULL default 1,
`batch_id` int(10) NOT NULL default 1,
`itemnumber` varchar(100) NOT NULL default '',
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`labelid`)
Expand Down
7 changes: 7 additions & 0 deletions installer/data/mysql/updatedatabase.pl
Expand Up @@ -2342,6 +2342,13 @@
SetVersion ($DBversion);
}

$DBversion = "3.01.00.024";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("ALTER TABLE labels MODIFY COLUMN batch_id int(10) NOT NULL default 1;");
print "Upgrade to $DBversion done (change labels.batch_id from varchar to int)\n";
SetVersion ($DBversion);
}

=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
Expand Down
2 changes: 1 addition & 1 deletion kohaversion.pl
Expand Up @@ -10,7 +10,7 @@
use strict;

sub kohaversion {
our $VERSION = '3.01.00.023';
our $VERSION = '3.01.00.024';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
Expand Down

0 comments on commit cd16f12

Please sign in to comment.