mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
fixed update problem of wiki, RenameColumn could not deal with column-names in mixed case
This commit is contained in:
parent
60ae406c63
commit
d9ba5f9ab8
@ -316,8 +316,24 @@
|
|||||||
function RenameColumn($sTableName, $sOldColumnName, $sNewColumnName, $bCopyData=True)
|
function RenameColumn($sTableName, $sOldColumnName, $sNewColumnName, $bCopyData=True)
|
||||||
{
|
{
|
||||||
$table_def = $this->GetTableDefinition($sTableName);
|
$table_def = $this->GetTableDefinition($sTableName);
|
||||||
|
|
||||||
|
if (isset($table_def['fd'][$sOldColumnName]))
|
||||||
|
{
|
||||||
|
$old_def = $table_def['fd'][$sOldColumnName];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($table_def['fd'] as $col => $def)
|
||||||
|
{
|
||||||
|
if (strlower($col) == strtolower($OldColumnName))
|
||||||
|
{
|
||||||
|
$old_def = $def;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$col_def = $this->_egw2adodb_columndef(array(
|
$col_def = $this->_egw2adodb_columndef(array(
|
||||||
'fd' => array($sNewColumnName => $table_def['fd'][strtolower($sOldColumnName)]),
|
'fd' => array($sNewColumnName => $old_def),
|
||||||
'pk' => array(),
|
'pk' => array(),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user