mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
Enhanced fix for Trac #503. Don't drop the column before re-creating it, in case the data can be converted by MySQL.
SVN:1.2[1892]
This commit is contained in:
@@ -899,13 +899,18 @@ EOF
|
|||||||
{
|
{
|
||||||
if (CMDBSource::IsField($sTable, $sAttCode))
|
if (CMDBSource::IsField($sTable, $sAttCode))
|
||||||
{
|
{
|
||||||
$aRepairQueries[] = "ALTER TABLE `$sTable` DROP COLUMN `$sAttCode`;";
|
$aRepairQueries[] = "ALTER TABLE `$sTable` CHANGE `$sAttCode` `$sAttCode` $sColumnDef";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$aFieldDefs[] = "`$sAttCode` $sColumnDef";
|
$aFieldDefs[] = "`$sAttCode` $sColumnDef";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (count($aFieldDefs) > 0)
|
||||||
|
{
|
||||||
$aRepairQueries[] = "ALTER TABLE `$sTable` ADD (".implode(',', $aFieldDefs).");";
|
$aRepairQueries[] = "ALTER TABLE `$sTable` ADD (".implode(',', $aFieldDefs).");";
|
||||||
|
}
|
||||||
|
|
||||||
// The triggers as well must be adjusted
|
// The triggers as well must be adjusted
|
||||||
$aTriggersDefs = $this->GetTriggersDefinition();
|
$aTriggersDefs = $this->GetTriggersDefinition();
|
||||||
|
|||||||
Reference in New Issue
Block a user