Show error when unique index creation fails

This commit is contained in:
Kijin Sung 2025-05-29 22:27:55 +09:00
parent 4632a10a31
commit fda92b368d
2 changed files with 7 additions and 3 deletions

View file

@ -388,7 +388,11 @@ class Member extends ModuleObject
}
if(!$oDB->isIndexExists('member_auth_mail', 'unique_auth_key'))
{
$oDB->addIndex('member_auth_mail', 'unique_auth_key', ['auth_key'], true);
$output = $oDB->addIndex('member_auth_mail', 'unique_auth_key', ['auth_key'], true);
if (!$output->toBool())
{
return $output;
}
}
if(!$oDB->isIndexExists('member_auth_mail', 'idx_member_srl'))
{

View file

@ -249,8 +249,8 @@ class Module extends ModuleObject
}
if(!$oDB->isIndexExists('module_part_config', 'unique_module_part_config'))
{
$oDB->addIndex('module_part_config', 'unique_module_part_config', array('module', 'module_srl'), true);
if(!$oDB->isIndexExists('module_part_config', 'unique_module_part_config'))
$output = $oDB->addIndex('module_part_config', 'unique_module_part_config', array('module', 'module_srl'), true);
if (!$output->toBool())
{
$oDB->addIndex('module_part_config', 'unique_module_part_config', array('module', 'module_srl'), false);
}