Change data type of module_config.config to bigtext

xpressengine/xe-core#2179
xpressengine/xe-core#2180
This commit is contained in:
Kijin Sung 2017-11-27 13:03:47 +09:00
parent 6d6acd5c9e
commit a8da651f29
4 changed files with 17 additions and 3 deletions

View file

@ -39,8 +39,8 @@ class DBCubrid extends DB
'varchar' => 'character varying', 'varchar' => 'character varying',
'char' => 'character', 'char' => 'character',
'tinytext' => 'character varying(256)', 'tinytext' => 'character varying(256)',
'text' => 'character varying(1073741823)',
'bigtext' => 'character varying(1073741823)', 'bigtext' => 'character varying(1073741823)',
'text' => 'character varying(1073741823)',
'date' => 'character varying(14)', 'date' => 'character varying(14)',
'float' => 'float', 'float' => 'float',
); );

View file

@ -32,8 +32,8 @@ class DBMssql extends DB
'number' => 'int', 'number' => 'int',
'varchar' => 'nvarchar', 'varchar' => 'nvarchar',
'char' => 'nchar', 'char' => 'nchar',
'text' => 'ntext',
'bigtext' => 'ntext', 'bigtext' => 'ntext',
'text' => 'ntext',
'date' => 'nvarchar(14)', 'date' => 'nvarchar(14)',
'float' => 'float', 'float' => 'float',
); );

View file

@ -105,6 +105,13 @@ class module extends ModuleObject
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$moduleConfig = $oModuleModel->getModuleConfig('module'); $moduleConfig = $oModuleModel->getModuleConfig('module');
if(!$moduleConfig->isUpdateFixedValue) return true; if(!$moduleConfig->isUpdateFixedValue) return true;
// check module_config data type
$column_info = $oDB->getColumnInfo('module_config', 'config');
if($column_info->xetype !== 'bigtext')
{
return true;
}
} }
/** /**
@ -380,6 +387,13 @@ class module extends ModuleObject
$output = $oModuleController->updateModuleConfig('module', $moduleConfig); $output = $oModuleController->updateModuleConfig('module', $moduleConfig);
} }
// check module_config data type
$column_info = $oDB->getColumnInfo('module_config', 'config');
if($column_info->xetype !== 'bigtext')
{
$oDB->modifyColumn('module_config', 'config', 'bigtext');
}
return new Object(0, 'success_updated'); return new Object(0, 'success_updated');
} }

View file

@ -1,6 +1,6 @@
<table name="module_config"> <table name="module_config">
<column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" /> <column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="site_srl" type="number" size="11" notnull="notnull" /> <column name="site_srl" type="number" size="11" notnull="notnull" />
<column name="config" type="text" /> <column name="config" type="bigtext" />
<column name="regdate" type="date" /> <column name="regdate" type="date" />
</table> </table>