- fixed: a bug in Crud where keys being updated would cause a crash
This commit is contained in:
parent
782a4396b5
commit
18b26f8bc0
2 changed files with 2 additions and 1 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue