* Adjust for upgrade.
This commit is contained in:
@@ -989,4 +989,8 @@ $config->upgrade->recoveryActions->testcase->review['position'] = 'browseandview
|
||||
|
||||
$config->upgrade->missedFlowFieldVersions = array('max4_4_alpha1', 'max4_4_beta1', 'max4_4', 'max4_5', 'biz8_4_alpha1', 'biz8_4_beta1', 'biz8_4', 'biz8_5');
|
||||
|
||||
$config->upgrade->dbFieldLengths['int'] = array('tinyint' => 4, 'smallint' => 6, 'mediumint' => 9, 'int' => 11, 'integer' => 11, 'bigint' => 20);
|
||||
$config->upgrade->dbFieldLengths['unsigned'] = array('tinyint' => 3, 'smallint' => 5, 'mediumint' => 8, 'int' => 10, 'integer' => 10, 'bigint' => 20);
|
||||
$config->upgrade->dbFieldLengths['text'] = array('tinytext' => 8, 'text' => 16, 'mediumtext' => 24, 'longtext' => 32);
|
||||
|
||||
include dirname(__FILE__) . DS . 'config' . DS . 'upgradeflow.php';
|
||||
|
||||
@@ -1021,16 +1021,22 @@ class upgradeModel extends model
|
||||
$dbIsInt = stripos($dbType, 'int') !== false;
|
||||
$dbIsVarchar = stripos($dbType, 'varchar') !== false;
|
||||
$dbIsText = stripos($dbType, 'text') !== false;
|
||||
if($dbIsInt and $dbLength == 0)
|
||||
{
|
||||
$intFieldLengths = zget($this->config->upgrade->dbFieldLengths, $dbConfigs[2] == 'unsigned' ? 'unsigned' : 'int', array());
|
||||
$dbLength = zget($intFieldLengths, $dbType, 0);
|
||||
}
|
||||
|
||||
if($dbLength > $stdLength) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($stdIsInt && $dbIsText) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($dbLength > $stdLength) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($stdIsInt && $dbIsText) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($stdIsVarchar && $dbIsText) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($stdIsText && $dbIsText)
|
||||
{
|
||||
if($stdType == 'text' && in_array($dbType, array('mediumtext', 'longtext'))) $stdConfigs[1] = $dbConfigs[1];
|
||||
if($stdType == 'mediumtext' && $dbType == 'longtext') $stdConfigs[1] = $dbConfigs[1];
|
||||
$textFieldLengths = $this->config->upgrade->dbFieldLengths['text'];
|
||||
if($textFieldLengths[$stdType] < $textFieldLengths[$dbType]) $stdConfigs[1] = $dbConfigs[1];
|
||||
}
|
||||
if(stripos($stdConfigs[1], 'int') === false && $stdConfigs[2] == 'unsigned') unset($stdConfigs[2]);
|
||||
|
||||
$line = implode(' ', $stdConfigs);
|
||||
if($line == $fields[$field]) continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user