mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +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))
|
||||
{
|
||||
$aRepairQueries[] = "ALTER TABLE `$sTable` DROP COLUMN `$sAttCode`;";
|
||||
$aRepairQueries[] = "ALTER TABLE `$sTable` CHANGE `$sAttCode` `$sAttCode` $sColumnDef";
|
||||
}
|
||||
else
|
||||
{
|
||||
$aFieldDefs[] = "`$sAttCode` $sColumnDef";
|
||||
}
|
||||
|
||||
$aFieldDefs[] = "`$sAttCode` $sColumnDef";
|
||||
}
|
||||
|
||||
$aRepairQueries[] = "ALTER TABLE `$sTable` ADD (".implode(',', $aFieldDefs).");";
|
||||
if (count($aFieldDefs) > 0)
|
||||
{
|
||||
$aRepairQueries[] = "ALTER TABLE `$sTable` ADD (".implode(',', $aFieldDefs).");";
|
||||
}
|
||||
|
||||
// The triggers as well must be adjusted
|
||||
$aTriggersDefs = $this->GetTriggersDefinition();
|
||||
|
||||
Reference in New Issue
Block a user