@@ -, +, @@ updated. a ctId column, but now has collections_tracking_id. passes. cleanly in an empty database. --- C4/RotatingCollections.pm | 2 +- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) --- a/C4/RotatingCollections.pm +++ a/C4/RotatingCollections.pm @@ -326,7 +326,7 @@ sub AddItemToCollection { my $dbh = C4::Context->dbh; my $sth; - $sth = $dbh->prepare("INSERT INTO collections_tracking ( ctId, colId, itemnumber ) + $sth = $dbh->prepare("INSERT INTO collections_tracking ( collections_tracking_id, colId, itemnumber ) VALUES ( NULL, ?, ? )"); $sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() ); --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -487,10 +487,10 @@ CREATE TABLE collections ( -- DROP TABLE IF EXISTS collections_tracking; CREATE TABLE collections_tracking ( - ctId integer(11) NOT NULL auto_increment, + collections_tracking_id integer(11) NOT NULL auto_increment, colId integer(11) NOT NULL DEFAULT 0 comment 'collections.colId', itemnumber integer(11) NOT NULL DEFAULT 0 comment 'items.itemnumber', - PRIMARY KEY (ctId) + PRIMARY KEY (collections_tracking_id) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8; -- --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7853,6 +7853,15 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.15.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + ALTER TABLE collections_tracking CHANGE ctId collections_tracking_id integer(11) NOT NULL auto_increment; + }); + print "Upgrade to $DBversion done (Bug 11384) - change name of collections_tracker.ctId column)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --