Add member_srl column and reorder columns in admin_log table #2421

This commit is contained in:
Kijin Sung 2024-11-16 22:32:56 +09:00
parent e4a100c896
commit e61723ce5c
2 changed files with 40 additions and 8 deletions

View file

@ -27,7 +27,23 @@ class adminlogging extends ModuleObject
*/ */
function checkUpdate() function checkUpdate()
{ {
return FALSE; $oDB = DB::getInstance();
if (!$oDB->isColumnExists('admin_log', 'member_srl'))
{
return true;
}
if (!$oDB->isIndexExists('admin_log', 'idx_member_srl'))
{
return true;
}
$column_info = $oDB->getColumnInfo('admin_log', 'request_vars');
if ($column_info->xetype !== 'bigtext')
{
return true;
}
return false;
} }
/** /**
@ -36,7 +52,21 @@ class adminlogging extends ModuleObject
*/ */
function moduleUpdate() function moduleUpdate()
{ {
$oDB = DB::getInstance();
if (!$oDB->isColumnExists('admin_log', 'member_srl'))
{
$oDB->addColumn('admin_log', 'member_srl', 'number', null, 0, true, 'site_srl');
}
if (!$oDB->isIndexExists('admin_log', 'idx_member_srl'))
{
$oDB->addIndex('admin_log', 'idx_member_srl', ['member_srl']);
}
$column_info = $oDB->getColumnInfo('admin_log', 'request_vars');
if ($column_info->xetype !== 'bigtext')
{
$oDB->modifyColumn('admin_log', 'request_vars', 'bigtext');
}
} }
/** /**

View file

@ -1,8 +1,10 @@
<table name="admin_log"> <table name="admin_log">
<column name="ipaddress" type="varchar" size="60" notnull="notnull" index="idx_admin_ip" /> <column name="id" type="number" notnull="notnull" primary_key="primary_key" auto_increment="auto_increment" />
<column name="regdate" type="date" index="idx_admin_date" /> <column name="site_srl" type="number" default="0" />
<column name="site_srl" type="number" size="11" default="0" /> <column name="member_srl" type="number" default="0" index="idx_member_srl" />
<column name="module" type="varchar" size="100" /> <column name="module" type="varchar" size="100" />
<column name="act" type="varchar" size="100" /> <column name="act" type="varchar" size="100" />
<column name="request_vars" type="text" /> <column name="request_vars" type="bigtext" />
<column name="regdate" type="date" index="idx_admin_date" />
<column name="ipaddress" type="varchar" size="60" notnull="notnull" index="idx_admin_ip" />
</table> </table>