From ddc3fd8fd1641a3f5027eb0b24f03e96adffa613 Mon Sep 17 00:00:00 2001 From: jf-cbd Date: Wed, 2 Sep 2026 11:45:50 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B07968=20-=20Renaming=20column=20can=20cau?= =?UTF-8?q?se=20problem=20when=20index=20exists,=20adding=20a=20fallback?= =?UTF-8?q?=20to=20the=20previous=20method=20in=20this=20specific=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/moduleinstaller.class.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/moduleinstaller.class.inc.php b/setup/moduleinstaller.class.inc.php index 5cdc5d0019..156e679021 100644 --- a/setup/moduleinstaller.class.inc.php +++ b/setup/moduleinstaller.class.inc.php @@ -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);