mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Show helpful error when unique_mid index creation fails, and remove unnecessary idx_mid index
This commit is contained in:
parent
2df0474a06
commit
4632a10a31
1 changed files with 9 additions and 7 deletions
|
|
@ -73,10 +73,8 @@ class Module extends ModuleObject
|
|||
// Add domain_srl column
|
||||
if (!$oDB->isColumnExists('modules', 'domain_srl')) return true;
|
||||
if (!$oDB->isIndexExists('modules', 'idx_domain_srl')) return true;
|
||||
if (!$oDB->isIndexExists('modules', 'idx_mid') && !$oDB->isIndexExists('modules', 'unique_mid'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!$oDB->isIndexExists('modules', 'unique_mid')) return true;
|
||||
if ($oDB->isIndexExists('modules', 'idx_mid')) return true;
|
||||
|
||||
// check fix mskin
|
||||
if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
|
||||
|
|
@ -206,11 +204,15 @@ class Module extends ModuleObject
|
|||
// Try adding a unique index on mid, but fall back to a regular index if not possible.
|
||||
if (!$oDB->isIndexExists('modules', 'unique_mid'))
|
||||
{
|
||||
$oDB->addIndex('modules', 'unique_mid', array('mid'), true);
|
||||
$output = $oDB->addIndex('modules', 'unique_mid', array('mid'), true);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
elseif (!$oDB->isIndexExists('modules', 'idx_mid'))
|
||||
if ($oDB->isIndexExists('modules', 'unique_mid') && $oDB->isIndexExists('modules', 'idx_mid'))
|
||||
{
|
||||
$oDB->addIndex('modules', 'idx_mid', array('mid'));
|
||||
$oDB->dropIndex('modules', 'idx_mid');
|
||||
}
|
||||
|
||||
// check ruleset directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue