mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
fixed schema_proc for pgSql to properly rename a table, if forgot to rename the index
This commit is contained in:
parent
486e0b043f
commit
ad1a0a1cb3
@ -517,10 +517,14 @@
|
|||||||
{
|
{
|
||||||
$indexes[] = $val['index_name'];
|
$indexes[] = $val['index_name'];
|
||||||
}
|
}
|
||||||
if(!in_array($sOldTableName . '_pkey',$indexes))
|
if(!in_array($sOldTableName . '_pkey',$indexes)) // no idea how this can happen
|
||||||
{
|
{
|
||||||
$oProc->m_odb->query("DROP INDEX " . $sOldTableName . "_pkey",__LINE__,__FILE__);
|
$oProc->m_odb->query("DROP INDEX " . $sOldTableName . "_pkey",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
|
else // rename the index
|
||||||
|
{
|
||||||
|
$oProc->m_odb->query('ALTER TABLE '.$sOldTableName.'_pkey RENAME TO '.$sNewTableName.'_pkey');
|
||||||
|
}
|
||||||
|
|
||||||
return !!($oProc->m_odb->query("ALTER TABLE $sOldTableName RENAME TO $sNewTableName"));
|
return !!($oProc->m_odb->query("ALTER TABLE $sOldTableName RENAME TO $sNewTableName"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user