Files
2026-09-15 10:26:34 +08:00

73 lines
4.4 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="customer_address_entity">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="sales_order_address">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="quote_address">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="directory_country_city" engine="innodb" comment="Directory Country City">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="City Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country Region Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_city_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_city_unique_code">
<column name="code"/>
</constraint>
</table>
<table name="directory_country_district" engine="innodb" comment="Directory Country District">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="District Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country City Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_city_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="foreign" referenceId="directory_country_district_code"
table="directory_country_district" column="parent_code" referenceTable="directory_country_city"
referenceColumn="code" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_district_unique_code">
<column name="code"/>
</constraint>
</table>
<table name="directory_country_town" engine="innodb" comment="Directory Country Town">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="Town Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country Town Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_town_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="foreign" referenceId="directory_country_city_code"
table="directory_country_town" column="parent_code" referenceTable="directory_country_district"
referenceColumn="code" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_town_unique_code">
<column name="code"/>
</constraint>
</table>
</schema>