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

209 lines
15 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_catalog_faq" resource="default" engine="innodb" comment="Esun Product FAQ">
<column xsi:type="int" name="faq_id" unsigned="true" nullable="false" identity="true" comment="FAQ ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="mediumtext" name="content" nullable="true" comment="Content"/>
<column xsi:type="varchar" name="store_ids" nullable="false" length="255" default="0" comment="Store IDs"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" 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="faq_id"/>
</constraint>
<index referenceId="ESUN_CATALOG_FAQ_STATUS_SORT" indexType="btree">
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_catalog_product_gallery" resource="default" engine="innodb" comment="Esun Product Detail Gallery Mapping">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" comment="Product ID"/>
<column xsi:type="int" name="value_id" unsigned="true" nullable="false" comment="Media Gallery Value ID"/>
<column xsi:type="varchar" name="section" nullable="false" length="64" default="detail_gallery" comment="Section"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" nullable="false" default="0" comment="Sort Order"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_CATALOG_PRODUCT_GALLERY_UNQ">
<column name="product_id"/>
<column name="value_id"/>
<column name="section"/>
</constraint>
<index referenceId="ESUN_CATALOG_PRODUCT_GALLERY_PRODUCT_SECTION" indexType="btree">
<column name="product_id"/>
<column name="section"/>
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_catalog_certification_type" resource="default" engine="innodb" comment="Esun Product Certification Type">
<column xsi:type="int" name="type_id" unsigned="true" nullable="false" identity="true" comment="Type ID"/>
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Certification Type Name"/>
<column xsi:type="varchar" name="icon" nullable="true" length="1024" comment="Icon Path"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" 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="type_id"/>
</constraint>
<index referenceId="ESUN_CATALOG_CERTIFICATION_TYPE_STATUS_SORT" indexType="btree">
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_catalog_specification_brand" resource="default" engine="innodb" comment="Esun Download Specification Brand">
<column xsi:type="int" name="brand_id" unsigned="true" nullable="false" identity="true" comment="Brand ID"/>
<column xsi:type="varchar" name="brand_name" nullable="false" length="255" comment="Brand Name"/>
<column xsi:type="varchar" name="brand_logo" nullable="true" length="1024" comment="Brand Logo"/>
<column xsi:type="smallint" name="is_product_specific" unsigned="true" nullable="false" default="1" comment="Is Product Specific"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" 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="brand_id"/>
</constraint>
<index referenceId="ESUN_CATALOG_SPEC_BRAND_STATUS_SORT" indexType="btree">
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_catalog_specification_import" resource="default" engine="innodb" comment="Esun Download Specification Import">
<column xsi:type="int" name="import_id" unsigned="true" nullable="false" identity="true" comment="Import ID"/>
<column xsi:type="int" name="brand_id" unsigned="true" nullable="false" comment="Brand ID"/>
<column xsi:type="varchar" name="archive_file" nullable="true" length="1024" comment="Archive File"/>
<column xsi:type="int" name="file_count" unsigned="true" nullable="false" default="0" comment="File Count"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<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="import_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_CATALOG_SPEC_IMPORT_BRAND_ID_SPEC_BRAND_BRAND_ID"
table="esun_catalog_specification_import" column="brand_id"
referenceTable="esun_catalog_specification_brand" referenceColumn="brand_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_CATALOG_SPEC_IMPORT_BRAND" indexType="btree">
<column name="brand_id"/>
<column name="updated_at"/>
</index>
</table>
<table name="esun_catalog_specification_file" resource="default" engine="innodb" comment="Esun Download Specification File">
<column xsi:type="int" name="file_id" unsigned="true" nullable="false" identity="true" comment="File ID"/>
<column xsi:type="int" name="import_id" unsigned="true" nullable="false" comment="Import ID"/>
<column xsi:type="int" name="brand_id" unsigned="true" nullable="false" comment="Brand ID"/>
<column xsi:type="varchar" name="brand_name" nullable="false" length="255" comment="Brand Name"/>
<column xsi:type="varchar" name="brand_logo" nullable="true" length="1024" comment="Brand Logo"/>
<column xsi:type="varchar" name="model_name" nullable="false" length="255" comment="Model Name"/>
<column xsi:type="varchar" name="file_name" nullable="false" length="512" comment="File Name"/>
<column xsi:type="varchar" name="file_path" nullable="false" length="1024" comment="File Path"/>
<column xsi:type="varchar" name="product_name_key" nullable="false" length="512" comment="Product Name Key"/>
<column xsi:type="smallint" name="is_product_specific" unsigned="true" nullable="false" default="1" comment="Is Product Specific"/>
<column xsi:type="int" name="file_size" unsigned="true" nullable="false" default="0" comment="File Size"/>
<column xsi:type="timestamp" name="file_mtime" nullable="true" comment="File Modified At"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="file_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_CATALOG_SPEC_FILE_IMPORT_ID_SPEC_IMPORT_IMPORT_ID"
table="esun_catalog_specification_file" column="import_id"
referenceTable="esun_catalog_specification_import" referenceColumn="import_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_CATALOG_SPEC_FILE_PRODUCT_KEY" indexType="btree">
<column name="product_name_key"/>
</index>
<index referenceId="ESUN_CATALOG_SPEC_FILE_BRAND_MODEL" indexType="btree">
<column name="brand_id"/>
<column name="model_name"/>
</index>
</table>
<table name="esun_catalog_color_option" resource="default" engine="innodb" comment="Esun Catalog Color Option Display">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
<column xsi:type="int" name="option_id" unsigned="true" nullable="false" comment="Color Attribute Option ID"/>
<column xsi:type="varchar" name="display_name" nullable="true" length="255" comment="Display Name"/>
<column xsi:type="text" name="swatch_colors" nullable="true" comment="Swatch Colors"/>
<column xsi:type="varchar" name="ball_image" nullable="true" length="1024" comment="Color Ball Image"/>
<column xsi:type="smallint" name="is_hot_sale" unsigned="true" nullable="false" default="0" comment="Is Hot Sale"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" 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="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_CATALOG_COLOR_OPTION_OPTION_ID">
<column name="option_id"/>
</constraint>
<index referenceId="ESUN_CATALOG_COLOR_OPTION_STATUS_SORT" indexType="btree">
<column name="status"/>
<column name="sort_order"/>
</index>
<index referenceId="ESUN_CATALOG_COLOR_OPTION_HOT_SALE" indexType="btree">
<column name="status"/>
<column name="is_hot_sale"/>
</index>
</table>
<table name="esun_product_recommendation_set" resource="default" engine="innodb"
comment="Esun Product Recommendation Set">
<column xsi:type="int" name="set_id" unsigned="true" nullable="false" identity="true" comment="Set ID"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" comment="Source Product ID"/>
<column xsi:type="smallint" name="website_id" unsigned="true" nullable="false" default="0"
comment="Website ID; 0 Is Default"/>
<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="set_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_PRODUCT_RECOMMENDATION_SET_PRODUCT_WEBSITE">
<column name="product_id"/>
<column name="website_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_PRD_RECOMMENDATION_SET_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
table="esun_product_recommendation_set" column="product_id"
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_PRD_RECOMMENDATION_SET_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
table="esun_product_recommendation_set" column="website_id"
referenceTable="store_website" referenceColumn="website_id" onDelete="CASCADE"/>
</table>
<table name="esun_product_recommendation_item" resource="default" engine="innodb"
comment="Esun Product Recommendation Item">
<column xsi:type="int" name="item_id" unsigned="true" nullable="false" identity="true" comment="Item ID"/>
<column xsi:type="int" name="set_id" unsigned="true" nullable="false" comment="Set ID"/>
<column xsi:type="int" name="recommended_product_id" unsigned="true" nullable="false"
comment="Recommended Product ID"/>
<column xsi:type="int" name="sort_order" unsigned="true" nullable="false" default="0" comment="Sort Order"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="item_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_PRODUCT_RECOMMENDATION_ITEM_SET_PRODUCT">
<column name="set_id"/>
<column name="recommended_product_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_PRD_RECOMMENDATION_ITEM_SET_ID_RECOMMENDATION_SET_SET_ID"
table="esun_product_recommendation_item" column="set_id"
referenceTable="esun_product_recommendation_set" referenceColumn="set_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_PRD_RECOMMENDATION_ITEM_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
table="esun_product_recommendation_item" column="recommended_product_id"
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<index referenceId="ESUN_PRODUCT_RECOMMENDATION_ITEM_SET_SORT" indexType="btree">
<column name="set_id"/>
<column name="sort_order"/>
</index>
</table>
</schema>