mirror of
https://github.com/Combodo/iTop.git
synced 2026-09-06 21:38:19 +02:00
N°7968 - Renaming column can cause problem when index exists, adding a fallback to the previous method in this specific case
This commit is contained in:
@@ -241,7 +241,7 @@ abstract class ModuleInstallerAPI
|
||||
}
|
||||
|
||||
// Simple rename
|
||||
if ($sOrigTable === $sDstTable && !$bDstTableFieldExists) {
|
||||
if ($sOrigTable === $sDstTable && !$bDstTableFieldExists && !CMDBSource::HasIndex($sOrigTable, $sOrigColumn)) {
|
||||
$sFieldSpec = CMDBSource::GetFieldSpec($sOrigTable, $sOrigColumn);
|
||||
$sQueryRename = /** @lang MariaDB */ "ALTER TABLE `{$sOrigTable}` CHANGE `{$sOrigColumn}` `{$sDstColumn}` {$sFieldSpec};";
|
||||
CMDBSource::Query($sQueryRename);
|
||||
|
||||
Reference in New Issue
Block a user