54 lines
3.7 KiB
XML
54 lines
3.7 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_image_category" resource="default" engine="innodb" comment="Esun Image Categories">
|
|
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" identity="true" comment="Category ID"/>
|
|
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Name"/>
|
|
<column xsi:type="varchar" name="identifier" nullable="false" length="128" comment="Identifier"/>
|
|
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
|
|
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
|
|
<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_IMAGE_CATEGORY_IDENTIFIER">
|
|
<column name="identifier"/>
|
|
</constraint>
|
|
<index referenceId="ESUN_IMAGE_CATEGORY_STATUS_SORT" indexType="btree">
|
|
<column name="status"/>
|
|
<column name="sort_order"/>
|
|
</index>
|
|
</table>
|
|
|
|
<table name="esun_image" resource="default" engine="innodb" comment="Esun Managed Images">
|
|
<column xsi:type="int" name="image_id" unsigned="true" nullable="false" identity="true" comment="Image ID"/>
|
|
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" comment="Category ID"/>
|
|
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
|
|
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
|
|
<column xsi:type="varchar" name="thumbnail_path" nullable="true" length="1024" comment="Thumbnail Path"/>
|
|
<column xsi:type="varchar" name="image_path" nullable="true" length="1024" comment="Image Path"/>
|
|
<column xsi:type="varchar" name="icon_path" nullable="true" length="1024" comment="Icon Path"/>
|
|
<column xsi:type="varchar" name="link_url" nullable="true" length="1024" comment="Link URL"/>
|
|
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
|
|
<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="image_id"/>
|
|
</constraint>
|
|
<constraint xsi:type="foreign" referenceId="ESUN_IMAGE_CATEGORY_ID_ESUN_IMAGE_CATEGORY_CATEGORY_ID"
|
|
table="esun_image" column="category_id"
|
|
referenceTable="esun_image_category" referenceColumn="category_id"
|
|
onDelete="NO ACTION"/>
|
|
<index referenceId="ESUN_IMAGE_CATEGORY_STATUS_SORT" indexType="btree">
|
|
<column name="category_id"/>
|
|
<column name="status"/>
|
|
<column name="sort_order"/>
|
|
</index>
|
|
</table>
|
|
</schema>
|