[Koha-bugs] [Bug 15207] Error on upgrade from 3.20.5 to 3.22 beta

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Nov 21 12:31:27 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15207

--- Comment #18 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Could something like this here work?
4234 sub stocknumber_checker { #code reused later on
4235   my @row;
4236   #drop the obsolete itemSStocknumber idx if it exists
4237   @row = $dbh->selectrow_array("SHOW INDEXES FROM items WHERE
key_name='itemsstocknumberidx'");
4238   $dbh->do("ALTER TABLE `items` DROP INDEX `itemsstocknumberidx`;") if
@row;
4239 
4240   #check itemstocknumber idx; remove it if it is unique
4241   @row = $dbh->selectrow_array("SHOW INDEXES FROM items WHERE
key_name='itemstocknumberidx' AND non_unique=0");
4242   $dbh->do("ALTER TABLE `items` DROP INDEX `itemstocknumberidx`;") if
@row;
4243 
4244   #add itemstocknumber index non-unique IF it still not exists
4245   @row = $dbh->selectrow_array("SHOW INDEXES FROM items WHERE
key_name='itemstocknumberidx'");
4246   $dbh->do("ALTER TABLE items ADD INDEX itemstocknumberidx
(stocknumber);") unless @row;
4247 }

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list