fixed update problem of wiki, RenameColumn could not deal with column-names in mixed case

This commit is contained in:
Ralf Becker 2005-02-27 19:51:24 +00:00
parent 60ae406c63
commit d9ba5f9ab8

View File

@ -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(),
)); ));