- fixed: a bug in Crud where keys being updated would cause a crash

This commit is contained in:
JT Smith 2008-11-26 17:20:02 +00:00
parent 782a4396b5
commit 18b26f8bc0
2 changed files with 2 additions and 1 deletions

View file

@ -465,7 +465,7 @@ sub crud_updateTable {
else {
$db->write("alter table $tableName add column ".$dbh->quote_identifier($property)." $fieldType $notNullClause $defaultClause");
}
if ($isKey) {
if ($isKey && !$tableFields{$property}{key}) {
$db->write("alter table $tableName add index ".$dbh->quote_identifier($property)." (".$dbh->quote_identifier($property).")");
}
delete $tableFields{$property};