mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 18:31:37 +02:00
fixed droping of non-existing primary keys
This commit is contained in:
parent
4549d52c56
commit
1b60e0f309
@ -611,7 +611,9 @@
|
|||||||
$pkeys = $oProc->m_odb->pkey_columns($sOldTableName);
|
$pkeys = $oProc->m_odb->pkey_columns($sOldTableName);
|
||||||
if(!in_array($sOldTableName . '_pkey',$indexes) && !isset($pkeys[0])) // no idea how this can happen
|
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
|
else // rename the index
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user