Files
2026-09-15 10:35:56 +08:00

92 lines
6.0 KiB
XML

<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="esun_wiki_category" resource="default" engine="innodb" comment="Esun Wiki Categories">
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" identity="true" comment="Category ID"/>
<column xsi:type="int" name="parent_id" unsigned="true" nullable="true" comment="Parent Category ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="varchar" name="slug" nullable="false" length="160" comment="URL Slug"/>
<column xsi:type="varchar" name="custom_url_path" nullable="true" length="255" comment="Custom URL Path"/>
<column xsi:type="varchar" name="logo_path" nullable="true" length="512" comment="Navigation Logo Path"/>
<column xsi:type="text" name="summary" nullable="true" comment="Summary"/>
<column xsi:type="mediumtext" name="content" nullable="true" comment="Wiki Content"/>
<column xsi:type="varchar" name="meta_title" nullable="true" length="255" comment="Meta Title"/>
<column xsi:type="text" name="meta_description" nullable="true" comment="Meta Description"/>
<column xsi:type="text" name="meta_keywords" nullable="true" comment="Meta Keywords"/>
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
<column xsi:type="smallint" name="is_default_open" unsigned="true" nullable="false" default="0"
comment="Is Open by Default"/>
<column xsi:type="smallint" name="is_clickable" unsigned="true" nullable="false" default="1"
comment="Can Open Wiki Content"/>
<column xsi:type="smallint" name="show_download_center" unsigned="true" nullable="false" default="0"
comment="Show Download Center"/>
<column xsi:type="smallint" name="show_parameter_comparison" unsigned="true" nullable="false" default="0"
comment="Show Parameter Comparison"/>
<column xsi:type="int" name="sort_order" unsigned="false" nullable="false" default="0" comment="Sort Order"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<column xsi:type="timestamp" name="updated_at" nullable="false" default="CURRENT_TIMESTAMP"
on_update="true" comment="Updated At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="category_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_WIKI_CATEGORY_SLUG">
<column name="slug"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_WIKI_CATEGORY_CUSTOM_URL_PATH">
<column name="custom_url_path"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_PARENT_ID_ESUN_WIKI_CATEGORY_CATEGORY_ID"
table="esun_wiki_category" column="parent_id"
referenceTable="esun_wiki_category" referenceColumn="category_id"
onDelete="SET NULL"/>
<index referenceId="ESUN_WIKI_CATEGORY_PARENT_SORT" indexType="btree">
<column name="parent_id"/>
<column name="sort_order"/>
<column name="category_id"/>
</index>
<index referenceId="ESUN_WIKI_CATEGORY_ACTIVE_SORT" indexType="btree">
<column name="is_active"/>
<column name="sort_order"/>
<column name="category_id"/>
</index>
</table>
<table name="esun_wiki_category_store" resource="default" engine="innodb"
comment="Esun Wiki Category Store Relations">
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" comment="Category ID"/>
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="false" comment="Store ID"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="category_id"/>
<column name="store_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_STORE_CATEGORY_ID_CATEGORY_CATEGORY_ID"
table="esun_wiki_category_store" column="category_id"
referenceTable="esun_wiki_category" referenceColumn="category_id"
onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_STORE_STORE_ID_STORE_STORE_ID"
table="esun_wiki_category_store" column="store_id"
referenceTable="store" referenceColumn="store_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_WIKI_CATEGORY_STORE_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
</table>
<table name="esun_wiki_homepage" resource="default" engine="innodb" comment="Esun Wiki Homepage">
<column xsi:type="int" name="homepage_id" unsigned="true" nullable="false" identity="true"
comment="Homepage ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="mediumtext" name="content" nullable="true" comment="Homepage Content"/>
<column xsi:type="varchar" name="meta_title" nullable="true" length="255" comment="Meta Title"/>
<column xsi:type="text" name="meta_description" nullable="true" comment="Meta Description"/>
<column xsi:type="text" name="meta_keywords" nullable="true" comment="Meta Keywords"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP"
comment="Created At"/>
<column xsi:type="timestamp" name="updated_at" nullable="false" default="CURRENT_TIMESTAMP"
on_update="true" comment="Updated At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="homepage_id"/>
</constraint>
</table>
</schema>