Clean up member_auth_mail table schema, adding auth_type column

This commit is contained in:
Kijin Sung 2023-11-28 22:08:22 +09:00
parent c2311f88be
commit b934b8638f
5 changed files with 41 additions and 7 deletions

View file

@ -170,6 +170,12 @@ class Member extends ModuleObject
if(!$oDB->isColumnExists('member_devices', 'device_token_type')) return true;
if(!$oDB->isColumnExists('member_devices', 'last_active_date')) return true;
// Check member_auth_mail table
if(!$oDB->isColumnExists('member_auth_mail', 'auth_type')) return true;
if(!$oDB->isIndexExists('member_auth_mail', 'unique_auth_key')) return true;
if(!$oDB->isIndexExists('member_auth_mail', 'idx_member_srl')) return true;
if($oDB->isIndexExists('member_auth_mail', 'unique_key')) return true;
// Update status column
$output = executeQuery('member.getDeniedAndStatus');
if ($output->data->count)
@ -383,6 +389,25 @@ class Member extends ModuleObject
$oDB->query("UPDATE member_devices SET last_active_date = regdate WHERE last_active_date = ''");
}
// Check member_auth_mail table
if(!$oDB->isColumnExists('member_auth_mail', 'auth_type'))
{
$oDB->addColumn('member_auth_mail', 'auth_type', 'varchar', '20', 'password_v1', true, 'new_password');
$oDB->query("UPDATE member_auth_mail SET auth_type = 'signup' WHERE is_register = 'Y'");
}
if(!$oDB->isIndexExists('member_auth_mail', 'unique_auth_key'))
{
$oDB->addIndex('member_auth_mail', 'unique_auth_key', ['auth_key'], true);
}
if(!$oDB->isIndexExists('member_auth_mail', 'idx_member_srl'))
{
$oDB->addIndex('member_auth_mail', 'idx_member_srl', ['member_srl']);
}
if($oDB->isIndexExists('member_auth_mail', 'unique_key'))
{
$oDB->dropIndex('member_auth_mail', 'unique_key');
}
// Update status column
$output = executeQuery('member.getDeniedAndStatus');
if ($output->data->count)