mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Increase size of type column in module_trigger table
This commit is contained in:
parent
f1f4ac7e69
commit
0710285582
2 changed files with 40 additions and 5 deletions
|
|
@ -107,6 +107,21 @@ class module extends ModuleObject
|
|||
if(!$oDB->isIndexExists('lang', 'idx_name')) return true;
|
||||
if(!$oDB->isIndexExists('lang', 'idx_lang_code')) return true;
|
||||
|
||||
// check module_trigger table
|
||||
if($oDB->isIndexExists('module_trigger', 'idx_trigger'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isIndexExists('module_trigger', 'idx_trigger_name'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
$column_info = $oDB->getColumnInfo('module_trigger', 'type');
|
||||
if($column_info->size < 120)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// check deprecated lang code
|
||||
$output = executeQuery('module.getLangCount', ['site_srl' => 0, 'lang_code' => 'jp']);
|
||||
if ($output->data->count > 0)
|
||||
|
|
@ -197,6 +212,26 @@ class module extends ModuleObject
|
|||
$oDB->addIndex('lang', 'idx_lang_code', array('lang_code'), false);
|
||||
}
|
||||
|
||||
// check module_trigger table
|
||||
if($oDB->isIndexExists('module_trigger', 'idx_trigger'))
|
||||
{
|
||||
$oDB->dropIndex('module_trigger', 'idx_trigger');
|
||||
}
|
||||
$column_info = $oDB->getColumnInfo('module_trigger', 'type');
|
||||
if($column_info->size < 120)
|
||||
{
|
||||
$oDB->modifyColumn('module_trigger', 'trigger_name', 'varchar', 80, null, true, null, null, 'latin1');
|
||||
$oDB->modifyColumn('module_trigger', 'called_position', 'varchar', 20, null, true, null, null, 'latin1');
|
||||
$oDB->modifyColumn('module_trigger', 'module', 'varchar', 80, null, true, null, null, 'latin1');
|
||||
$oDB->modifyColumn('module_trigger', 'type', 'varchar', 120, null, true, null, null, 'latin1');
|
||||
$oDB->modifyColumn('module_trigger', 'called_method', 'varchar', 80, null, true, null, null, 'latin1');
|
||||
}
|
||||
if(!$oDB->isIndexExists('module_trigger', 'idx_trigger_name'))
|
||||
{
|
||||
$oDB->addIndex('module_trigger', 'idx_trigger_name', array('trigger_name', 'called_position'));
|
||||
$oDB->addIndex('module_trigger', 'idx_trigger_target', array('module', 'type', 'called_method'));
|
||||
}
|
||||
|
||||
// check deprecated lang code
|
||||
$output = executeQuery('module.getLangCount', ['site_srl' => 0, 'lang_code' => 'jp']);
|
||||
if ($output->data->count > 0)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<table name="module_trigger">
|
||||
<column name="trigger_name" type="varchar" size="80" notnull="notnull" unique="idx_trigger" charset="latin1" />
|
||||
<column name="called_position" type="varchar" size="20" notnull="notnull" unique="idx_trigger" charset="latin1" />
|
||||
<column name="module" type="varchar" size="80" notnull="notnull" unique="idx_trigger" charset="latin1" />
|
||||
<column name="type" type="varchar" size="80" notnull="notnull" unique="idx_trigger" charset="latin1" />
|
||||
<column name="called_method" type="varchar" size="80" notnull="notnull" unique="idx_trigger" charset="latin1" />
|
||||
<column name="trigger_name" type="varchar" size="80" notnull="notnull" index="idx_trigger_name" charset="latin1" />
|
||||
<column name="called_position" type="varchar" size="20" notnull="notnull" index="idx_trigger_name" charset="latin1" />
|
||||
<column name="module" type="varchar" size="80" notnull="notnull" index="idx_trigger_target" charset="latin1" />
|
||||
<column name="type" type="varchar" size="120" notnull="notnull" index="idx_trigger_target" charset="latin1" />
|
||||
<column name="called_method" type="varchar" size="80" notnull="notnull" index="idx_trigger_target" charset="latin1" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue