Fix for typo, leftover index on 046 updatedb commit.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan Higgins 2008-01-08 20:08:41 -06:00 committed by Joshua Ferraro
parent ffd3a01119
commit 17897d254a
2 changed files with 2 additions and 3 deletions

View file

@ -1886,7 +1886,7 @@ CREATE TABLE language_script_mapping (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS serialitems;
CREATE TABLE serialitem (
CREATE TABLE serialitems (
serialid int(11) NOT NULL,
itemnumber int(11) NOT NULL,
UNIQUE KEY `serialididx` (`serialid`)

View file

@ -934,10 +934,9 @@ $DBversion = "3.00.00.046";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("ALTER TABLE `subscription` CHANGE `numberlength` `numberlength` int(11) default NULL ,
CHANGE `weeklength` `weeklength` int(11) default NULL");
$dbh->do("ALTER TABLE `serial` ADD UNIQUE KEY `serialitemidx` (`serialitem`)");
$dbh->do("CREATE TABLE `serialitems` (`serialid` int(11) NOT NULL, `itemnumber` int(11) NOT NULL, UNIQUE KEY (`serialid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
$dbh->do("INSERT INTO `serialitems` SELECT `serialid`,`itemnumber` from serial where NOT ISNULL(itemnumber) && itemnumber <> '' && itemnumber NOT LIKE '%,%'");
print "Upgrade to $DBversion done (Update serial table, add index on itemnumber. )\n";
print "Upgrade to $DBversion done (Add serialitems table to link serial issues to items. )\n";
SetVersion ($DBversion);
}