Remove duplicate index in ncenterlite module

This commit is contained in:
Kijin Sung 2016-07-26 23:08:38 +09:00
parent d8ea756244
commit b6c56dd14c

View file

@ -124,12 +124,13 @@ class ncenterlite extends ModuleObject
return true; return true;
} }
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_notify')) if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl'))
{ {
return true; return true;
} }
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl')) // PK duplicate
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
{ {
return true; return true;
} }
@ -202,16 +203,17 @@ class ncenterlite extends ModuleObject
$oDB->addIndex('ncenterlite_notify', 'idx_target_p_srl', array('target_p_srl')); $oDB->addIndex('ncenterlite_notify', 'idx_target_p_srl', array('target_p_srl'));
} }
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
{
$oDB->addIndex('ncenterlite_notify', 'idx_notify', array('notify'));
}
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl')) if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl'))
{ {
$oDB->addIndex('ncenterlite_notify', 'idx_target_member_srl', array('target_member_srl')); $oDB->addIndex('ncenterlite_notify', 'idx_target_member_srl', array('target_member_srl'));
} }
// PK duplicate
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
{
$oDB->dropIndex('ncenterlite_notify', 'idx_notify');
}
return new Object(0, 'success_updated'); return new Object(0, 'success_updated');
} }