fixed droping of non-existing primary keys

This commit is contained in:
Ralf Becker 2004-05-30 11:18:47 +00:00
parent 4549d52c56
commit 1b60e0f309

View File

@ -611,7 +611,9 @@
$pkeys = $oProc->m_odb->pkey_columns($sOldTableName);
if(!in_array($sOldTableName . '_pkey',$indexes) && !isset($pkeys[0])) // no idea how this can happen
{
$oProc->m_odb->query("ALTER TABLE " . $sOldTableName . " DROP CONSTRAINT " . $sOldTableName . "_pkey",__LINE__,__FILE__);
// this happens if the table has no primary key --> nothing to do
// trying to drop the (not existing) constrain results in an error
//$oProc->m_odb->query("ALTER TABLE " . $sOldTableName . " DROP CONSTRAINT " . $sOldTableName . "_pkey",__LINE__,__FILE__);
}
else // rename the index
{