mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
module_part_config 테이블에 unique key 추가
xpressengine/xe-core#2242 이미 있는 idx_module_part_config 인덱스를 대체함.
This commit is contained in:
parent
bb6dc77acd
commit
26ddd6cdc3
2 changed files with 40 additions and 7 deletions
|
|
@ -54,7 +54,7 @@ class module extends ModuleObject
|
|||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2008. 10. 27 Add multi-index in the table, the module_part_config
|
||||
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
|
||||
if(!$oDB->isIndexExists('module_part_config', 'idx_module_part_config') && !$oDB->isIndexExists('module_part_config', 'unique_module_part_config')) return true;
|
||||
// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
|
||||
if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
|
||||
// Move permissions/skin information of all modules to the table, grants.
|
||||
|
|
@ -103,6 +103,17 @@ class module extends ModuleObject
|
|||
$oModuleModel = getModel('module');
|
||||
$moduleConfig = $oModuleModel->getModuleConfig('module');
|
||||
if(!$moduleConfig->isUpdateFixedValue) return true;
|
||||
|
||||
// check unique index on module_part_config
|
||||
if($oDB->isIndexExists('module_part_config', 'idx_module_part_config')) return true;
|
||||
if(!$oDB->isIndexExists('module_part_config', 'unique_module_part_config')) return true;
|
||||
|
||||
// check module_part_config data type
|
||||
$column_info = $oDB->getColumnInfo('module_part_config', 'config');
|
||||
if($column_info->xetype !== 'bigtext')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// check module_config data type
|
||||
$column_info = $oDB->getColumnInfo('module_config', 'config');
|
||||
|
|
@ -119,7 +130,7 @@ class module extends ModuleObject
|
|||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
|
||||
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config"))
|
||||
if(!$oDB->isIndexExists('module_part_config', 'idx_module_part_config') && !$oDB->isIndexExists('module_part_config', 'unique_module_part_config'))
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
|
|
@ -176,8 +187,8 @@ class module extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
|
||||
}
|
||||
|
||||
// 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
|
||||
if(!$oDB->isIndexExists('modules',"idx_site_mid"))
|
||||
{
|
||||
|
|
@ -185,17 +196,20 @@ class module extends ModuleObject
|
|||
$oDB->addColumn('modules','site_srl','number',11,0,true);
|
||||
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
|
||||
}
|
||||
|
||||
// document extra vars
|
||||
if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
|
||||
|
||||
if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
|
||||
|
||||
// Move permission, skin info, extection info, admin ID of all modules to the table, grants
|
||||
if($oDB->isColumnExists('modules', 'grants'))
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
// Get a value of the current system language code
|
||||
$lang_code = Context::getLangType();
|
||||
|
||||
// Get module_info of all modules
|
||||
$output = executeQueryArray('module.getModuleInfos');
|
||||
if(count($output->data))
|
||||
|
|
@ -290,6 +304,7 @@ class module extends ModuleObject
|
|||
} // for total_pages
|
||||
} // if count
|
||||
}
|
||||
|
||||
// Additional variables of the module, remove
|
||||
$module_info->grant = null;
|
||||
$module_info->extra_vars = null;
|
||||
|
|
@ -300,6 +315,7 @@ class module extends ModuleObject
|
|||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
}
|
||||
}
|
||||
|
||||
// Various column drop
|
||||
$oDB->dropColumn('modules','grants');
|
||||
$oDB->dropColumn('modules','admin_id');
|
||||
|
|
@ -385,6 +401,23 @@ class module extends ModuleObject
|
|||
$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
|
||||
}
|
||||
|
||||
// check unique index on module_part_config
|
||||
if($oDB->isIndexExists('module_part_config', 'idx_module_part_config'))
|
||||
{
|
||||
$oDB->dropIndex('module_part_config', 'idx_module_part_config');
|
||||
}
|
||||
if(!$oDB->isIndexExists('module_part_config', 'unique_module_part_config'))
|
||||
{
|
||||
$oDB->addIndex('module_part_config', 'unique_module_part_config', array('module', 'module_srl'), true);
|
||||
}
|
||||
|
||||
// check module_part_config data type
|
||||
$column_info = $oDB->getColumnInfo('module_part_config', 'config');
|
||||
if($column_info->xetype !== 'bigtext')
|
||||
{
|
||||
$oDB->modifyColumn('module_part_config', 'config', 'bigtext');
|
||||
}
|
||||
|
||||
// check module_config data type
|
||||
$column_info = $oDB->getColumnInfo('module_config', 'config');
|
||||
if($column_info->xetype !== 'bigtext')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<table name="module_part_config">
|
||||
<column name="module" type="varchar" size="180" notnull="notnull" utf8mb4="false" />
|
||||
<column name="module_srl" type="number" size="11" notnull="notnull" />
|
||||
<column name="config" type="text" />
|
||||
<column name="module" type="varchar" size="180" notnull="notnull" unique="unique_module_part_config" utf8mb4="false" />
|
||||
<column name="module_srl" type="number" size="11" notnull="notnull" unique="unique_module_part_config" />
|
||||
<column name="config" type="bigtext" />
|
||||
<column name="regdate" type="date" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue