52 lines
4.4 KiB
XML
52 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="esun_customer_vat" resource="default" engine="innodb" comment="eSUN Customer VAT Applications">
|
|
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
|
|
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" comment="Customer ID"/>
|
|
<column xsi:type="varchar" name="company_name" nullable="false" length="255" comment="Company Name"/>
|
|
<column xsi:type="varchar" name="country_id" nullable="false" length="2" comment="VAT Country"/>
|
|
<column xsi:type="varchar" name="vat_number" nullable="false" length="64" comment="VAT Number"/>
|
|
<column xsi:type="varchar" name="normalized_vat_number" nullable="false" length="64" comment="Normalized VAT Number"/>
|
|
<column xsi:type="varchar" name="status" nullable="false" length="16" default="pending" comment="Review Status"/>
|
|
<column xsi:type="text" name="review_note" nullable="true" comment="Review Note"/>
|
|
<column xsi:type="int" name="reviewed_by" unsigned="true" nullable="true" comment="Admin User ID"/>
|
|
<column xsi:type="timestamp" name="reviewed_at" on_update="false" nullable="true" comment="Reviewed At"/>
|
|
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
|
|
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Updated At"/>
|
|
<constraint xsi:type="primary" referenceId="PRIMARY"><column name="entity_id"/></constraint>
|
|
<constraint xsi:type="foreign" referenceId="ESUN_CUSTOMER_VAT_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
|
|
table="esun_customer_vat" column="customer_id" referenceTable="customer_entity"
|
|
referenceColumn="entity_id" onDelete="CASCADE"/>
|
|
<constraint xsi:type="unique" referenceId="ESUN_CUSTOMER_VAT_CUSTOMER_COUNTRY_NUMBER">
|
|
<column name="customer_id"/><column name="country_id"/><column name="normalized_vat_number"/>
|
|
</constraint>
|
|
<index referenceId="ESUN_CUSTOMER_VAT_CUSTOMER_STATUS_COUNTRY" indexType="btree">
|
|
<column name="customer_id"/><column name="status"/><column name="country_id"/>
|
|
</index>
|
|
<index referenceId="ESUN_CUSTOMER_VAT_STATUS_CREATED" indexType="btree">
|
|
<column name="status"/><column name="created_at"/>
|
|
</index>
|
|
</table>
|
|
|
|
<table name="quote" resource="checkout">
|
|
<column xsi:type="int" name="esun_vat_id" unsigned="true" nullable="true" comment="Matched VAT Application ID"/>
|
|
<column xsi:type="varchar" name="esun_vat_number" nullable="true" length="64" comment="VAT Number Snapshot"/>
|
|
<column xsi:type="varchar" name="esun_vat_country_id" nullable="true" length="2" comment="VAT Country Snapshot"/>
|
|
<column xsi:type="varchar" name="esun_vat_company_name" nullable="true" length="255" comment="VAT Company Snapshot"/>
|
|
<column xsi:type="smallint" name="esun_vat_exempt" unsigned="true" nullable="false" default="0" comment="VAT Exempt"/>
|
|
<column xsi:type="decimal" name="esun_nominal_tax_rate" scale="4" precision="12" nullable="false" default="0" comment="Nominal Tax Rate"/>
|
|
<column xsi:type="varchar" name="esun_tax_mode" nullable="false" length="32" default="" comment="Tax Mode"/>
|
|
</table>
|
|
|
|
<table name="sales_order" resource="sales">
|
|
<column xsi:type="int" name="esun_vat_id" unsigned="true" nullable="true" comment="Matched VAT Application ID"/>
|
|
<column xsi:type="varchar" name="esun_vat_number" nullable="true" length="64" comment="VAT Number Snapshot"/>
|
|
<column xsi:type="varchar" name="esun_vat_country_id" nullable="true" length="2" comment="VAT Country Snapshot"/>
|
|
<column xsi:type="varchar" name="esun_vat_company_name" nullable="true" length="255" comment="VAT Company Snapshot"/>
|
|
<column xsi:type="smallint" name="esun_vat_exempt" unsigned="true" nullable="false" default="0" comment="VAT Exempt"/>
|
|
<column xsi:type="decimal" name="esun_nominal_tax_rate" scale="4" precision="12" nullable="false" default="0" comment="Nominal Tax Rate"/>
|
|
<column xsi:type="varchar" name="esun_tax_mode" nullable="false" length="32" default="" comment="Tax Mode"/>
|
|
</table>
|
|
</schema>
|