Index: branches/5.2.x/install/upgrades.php =================================================================== diff -u -N -r15213 -r15376 --- branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 15213) +++ branches/5.2.x/install/upgrades.php (.../upgrades.php) (revision 15376) @@ -1,6 +1,6 @@ Application->getUnitOption('pt', 'TableName'); + $table_structure = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); + + if ( isset($table_structure['Description']) ) { + $sql = 'UPDATE ' . $table_name . ' + SET Description = "" + WHERE Description IS NULL'; + $this->Conn->Query($sql); + + $sql = 'ALTER TABLE ' . $table_name . ' + CHANGE `Description` `Description` VARCHAR(255) NOT NULL DEFAULT ""'; + $this->Conn->Query($sql); + } + + $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + + $ml_helper->createFields('pt'); + + if ( isset($table_structure['Description']) ) { + $sql = 'UPDATE ' . $table_name . ' + SET + l' . $this->Application->GetDefaultLanguageId() . '_Description = Description, + l' . $this->Application->GetDefaultLanguageId() . '_Instructions = Instructions'; + $this->Conn->Query($sql); + + $sql = 'ALTER TABLE ' . $table_name . ' DROP Description, DROP Instructions'; + $this->Conn->Query($sql); + } + } } \ No newline at end of file