Cleanup related to document_extra_vars

This commit is contained in:
Kijin Sung 2025-10-23 13:10:21 +09:00
parent 2a7eeebcbd
commit bef2871ce7
3 changed files with 20 additions and 18 deletions

View file

@ -87,9 +87,6 @@ class Document extends ModuleObject
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
if($oDB->isIndexExists("document_extra_vars", "unique_module_vars")) return true;
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
// 2011. 10. 25 status index check
if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
@ -117,6 +114,9 @@ class Document extends ModuleObject
if(!$oDB->isColumnExists('document_extra_keys', 'var_sort')) return true;
if(!$oDB->isColumnExists('document_extra_vars', 'sort_value') || !$oDB->isIndexExists('document_extra_vars', 'idx_sort_value')) return true;
// Delete unnecessary index
if($oDB->isIndexExists('document_extra_vars', 'idx_document_list_order')) return true;
return false;
}
@ -182,12 +182,7 @@ class Document extends ModuleObject
$oDB->dropIndex("document_extra_vars", "unique_module_vars", true);
}
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order"))
{
$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false);
}
// 2011. 10. 25 status index check
if(!$oDB->isIndexExists("documents", "idx_module_status"))
{
$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
@ -266,7 +261,13 @@ class Document extends ModuleObject
}
}
$oDB->commit();
$oDB->addIndex('document_extra_vars', 'idx_sort_value', array('sort_value'));
$oDB->addIndex('document_extra_vars', 'idx_sort_value', array('module_srl', 'sort_value'));
}
// Delete unnecessary index
if($oDB->isIndexExists('document_extra_vars', 'idx_document_list_order'))
{
$oDB->dropIndex('document_extra_vars', 'idx_document_list_order');
}
}

View file

@ -3,7 +3,7 @@
<table name="document_extra_vars" />
</tables>
<columns>
<column name="sort_value" default="CAST(value AS UNSIGNED)" />
<column name="sort_value" default="CAST(value AS SIGNED)" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />

View file

@ -1,9 +1,10 @@
<table name="document_extra_vars">
<column name="module_srl" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="document_srl" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="var_idx" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="lang_code" type="varchar" size="10" notnull="notnull" unique="unique_extra_vars" />
<column name="value" type="bigtext" />
<column name="sort_value" type="bigint" index="idx_sort_value" />
<column name="eid" type="varchar" size="40" />
<column name="module_srl" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="document_srl" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="var_idx" type="number" size="11" notnull="notnull" unique="unique_extra_vars" />
<column name="lang_code" type="varchar" size="10" notnull="notnull" unique="unique_extra_vars" />
<column name="value" type="bigtext" />
<column name="sort_value" type="bigint" />
<column name="eid" type="varchar" size="40" />
<index name="idx_sort_value" columns="module_srl,sort_value" />
</table>