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

--- Comment #18 from Katrin Fischer <[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to