mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add unique index on mid
This commit is contained in:
parent
be1cad3182
commit
fbfbaa48a5
2 changed files with 12 additions and 3 deletions
|
|
@ -73,7 +73,10 @@ 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')) return true;
|
||||
if (!$oDB->isIndexExists('modules', 'idx_mid') && !$oDB->isIndexExists('modules', 'unique_mid'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// check fix mskin
|
||||
if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
|
||||
|
|
@ -193,7 +196,13 @@ class Module extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('modules', 'idx_domain_srl', array('domain_srl'));
|
||||
}
|
||||
if (!$oDB->isIndexExists('modules', 'idx_mid'))
|
||||
|
||||
// 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);
|
||||
}
|
||||
elseif (!$oDB->isIndexExists('modules', 'idx_mid'))
|
||||
{
|
||||
$oDB->addIndex('modules', 'idx_mid', array('mid'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<column name="menu_srl" type="number" size="11" notnull="notnull" default="0" />
|
||||
<column name="site_srl" type="number" size="11" notnull="notnull" default="0" />
|
||||
<column name="domain_srl" type="number" size="11" notnull="notnull" default="-1" index="idx_domain_srl" />
|
||||
<column name="mid" type="varchar" size="40" notnull="notnull" />
|
||||
<column name="mid" type="varchar" size="40" notnull="notnull" unique="unique_mid" />
|
||||
<column name="layout_srl" type="number" size="11" default="0" />
|
||||
<column name="mlayout_srl" type="number" size="11" default="0" />
|
||||
<column name="use_mobile" type="char" size="1" default="N" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue