File: /var/www/vhost/disk-apps/magento.bikenow.co/vendor/vertex/module-tax/etc/db_schema.xml
<?xml version="1.0"?>
<!--
/**
* @copyright Vertex. All rights reserved. https://www.vertexinc.com/
* @author Mediotype https://www.mediotype.com/
*/
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="vertex_taxrequest" comment="The tax request table">
<column xsi:type="bigint" name="request_id" padding="20" nullable="false" unsigned="false" identity="true" comment="Request Id"/>
<column xsi:type="varchar" name="request_type" nullable="false" length="255" comment="Request type"/>
<column xsi:type="bigint" name="quote_id" padding="20" nullable="false" comment="Quote Id"/>
<column xsi:type="bigint" name="order_id" padding="20" nullable="false" comment="Order Id"/>
<column xsi:type="varchar" name="total_tax" nullable="false" length="255" comment="Total Tax Amount"/>
<column xsi:type="varchar" name="source_path" nullable="false" length="255" comment="Source path controller_module_action"/>
<column xsi:type="varchar" name="tax_area_id" nullable="false" length="255" comment="Tax Jurisdictions Id"/>
<column xsi:type="varchar" name="sub_total" nullable="false" length="255" comment="Response Subtotal Amount"/>
<column xsi:type="varchar" name="total" nullable="false" length="255" comment="Response Total Amount"/>
<column xsi:type="varchar" name="lookup_result" nullable="false" length="255" comment="Tax Area Response Lookup Result"/>
<column xsi:type="timestamp" name="request_date" nullable="false" default="CURRENT_TIMESTAMP" comment="Request create date"/>
<column xsi:type="text" name="request_xml" nullable="false" comment="Request XML"/>
<column xsi:type="text" name="response_xml" nullable="false" comment="Response XML"/>
<column xsi:type="int" name="response_time" default="null" nullable="false" unsigned="true" comment="Milliseconds taken for Vertex API call to complete"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="request_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="VERTEX_TAXREQUEST_REQUEST_ID">
<column name="request_id"/>
</constraint>
<index referenceId="VERTEX_TAXREQUEST_REQUEST_TYPE" indexType="btree">
<column name="request_type"/>
</index>
<index referenceId="VERTEX_TAXREQUEST_ORDER_ID" indexType="btree">
<column name="order_id"/>
</index>
</table>
<table name="vertex_sales_creditmemo_item_invoice_text_code" comment="Creditmemo text code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" comment="Creditmemo Item ID"/>
<column xsi:type="varchar" name="invoice_text_code" nullable="false" length="100" comment="Invoice text code from Vertex"/>
<constraint xsi:type="unique" referenceId="UNQ_4BC40DA748D7713ADA661D2DE1BCF161">
<column name="item_id"/>
<column name="invoice_text_code"/>
</constraint>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_INVOICE_TEXT_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_INVOICE_TEXT_CODE_INVOICE_TEXT_CODE" indexType="btree">
<column name="invoice_text_code"/>
</index>
</table>
<table name="vertex_sales_creditmemo_item_tax_code" comment="Creditmemo tax code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" comment="Creditmemo Item ID"/>
<column xsi:type="varchar" name="tax_code" nullable="false" length="100" comment="Invoice text code from Vertex"/>
<constraint xsi:type="unique" referenceId="VERTEX_SALES_CREDITMEMO_ITEM_TAX_CODE_ITEM_ID_TAX_CODE">
<column name="item_id"/>
<column name="tax_code"/>
</constraint>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_TAX_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_TAX_CODE_TAX_CODE" indexType="btree">
<column name="tax_code"/>
</index>
</table>
<table name="vertex_sales_creditmemo_item_vertex_tax_code" comment="Creditmemo vertex tax code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" comment="Creditmemo Item ID"/>
<column xsi:type="varchar" name="vertex_tax_code" nullable="false" length="100" comment="Invoice text code from Vertex"/>
<constraint xsi:type="unique" referenceId="UNQ_31D7AADB3412BC7E7C1C98D5CC3A5D46">
<column name="item_id"/>
<column name="vertex_tax_code"/>
</constraint>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_VERTEX_TAX_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_CREDITMEMO_ITEM_VERTEX_TAX_CODE_VERTEX_TAX_CODE" indexType="btree">
<column name="vertex_tax_code"/>
</index>
</table>
<table name="vertex_custom_option_flex_field" comment="Customizable Option to Flex Field Map">
<column xsi:type="int" name="entity_id" padding="10" nullable="false" identity="true" unsigned="false" comment="Map Entity ID"/>
<column xsi:type="int" name="option_id" padding="10" nullable="false" comment="Customizable Option ID"/>
<column xsi:type="int" name="website_id" padding="10" nullable="false" default="0" comment="Website ID"/>
<column xsi:type="int" name="flex_field" padding="10" nullable="true" default="0" comment="Customizable Option to Flex Field Map"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="VERTEX_CUSTOM_OPTION_FLEX_FIELD_OPTION_ID_WEBSITE_ID">
<column name="option_id"/>
<column name="website_id"/>
</constraint>
<index referenceId="VERTEX_CUSTOM_OPTION_FLEX_FIELD_OPTION_ID" indexType="btree">
<column name="option_id"/>
</index>
<index referenceId="VERTEX_CUSTOM_OPTION_FLEX_FIELD_WEBSITE_ID" indexType="btree">
<column name="website_id"/>
</index>
</table>
<table name="vertex_customer_code" comment="Customer Code for Vertex">
<column xsi:type="int" name="customer_id" padding="10" nullable="false" unsigned="true" comment="Customer ID"/>
<column xsi:type="text" name="customer_code" nullable="true" comment="Customer Code for Vertex"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="customer_id"/>
</constraint>
</table>
<table name="vertex_customer_country" comment="Country associated to Customer">
<column xsi:type="int" name="customer_id" padding="10" nullable="false" unsigned="true" comment="Customer ID"/>
<column xsi:type="varchar" name="customer_country" nullable="true" comment="Customer Country"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="customer_id"/>
</constraint>
</table>
<table name="vertex_vat_country_code" comment="Vat Country code associated to Order Address">
<column xsi:type="int" name="address_id" padding="10" nullable="false" unsigned="true" comment="Address ID"/>
<column xsi:type="varchar" name="customer_country" nullable="true" comment="Customer Country"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="address_id"/>
</constraint>
</table>
<table name="vertex_commodity_code_product" comment="Vertex Commodity Code">
<column xsi:type="int" name="product_id" padding="10" nullable="false" unsigned="true" comment="Product ID"/>
<column xsi:type="varchar" name="code" nullable="true" comment="Commodity Code"/>
<column xsi:type="varchar" name="type" nullable="true" comment="Commodity Type"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="product_id"/>
</constraint>
</table>
<table name="vertex_commodity_code_order_item" comment="Vertex Commodity Code">
<column xsi:type="int" name="order_item_id" padding="10" nullable="false" unsigned="true" comment="Item ID"/>
<column xsi:type="varchar" name="code" nullable="true" comment="Commodity Code"/>
<column xsi:type="varchar" name="type" nullable="true" comment="Commodity Type"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="order_item_id"/>
</constraint>
</table>
<table name="vertex_order_invoice_status" comment="Invoice has been logged in Vertex">
<column xsi:type="int" name="order_id" padding="10" nullable="false" unsigned="true" comment="Order ID"/>
<column xsi:type="boolean" name="sent_to_vertex" nullable="false" default="0" comment="Invoice has been logged in Vertex"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="order_id"/>
</constraint>
</table>
<table name="vertex_sales_order_item_invoice_text_code" comment="Invoice text code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" unsigned="true" comment="Order ID"/>
<column xsi:type="varchar" name="invoice_text_code" nullable="false" length="100" comment="Invoice text code from Vertex"/>
<constraint xsi:type="unique" referenceId="UNQ_96F6BE3160A4185CEA4D866018EAF6DC">
<column name="item_id"/>
<column name="invoice_text_code"/>
</constraint>
<index referenceId="VERTEX_SALES_ORDER_ITEM_INVOICE_TEXT_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_ORDER_ITEM_INVOICE_TEXT_CODE_INVOICE_TEXT_CODE" indexType="btree">
<column name="invoice_text_code"/>
</index>
</table>
<table name="vertex_sales_order_item_tax_code" comment="Invoice tax code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" comment="Creditmemo Item ID"/>
<column xsi:type="varchar" name="tax_code" nullable="false" length="100" comment="Invoice text code from Vertex"/>
<constraint xsi:type="unique" referenceId="VERTEX_SALES_ORDER_ITEM_TAX_CODE_ITEM_ID_TAX_CODE">
<column name="item_id"/>
<column name="tax_code"/>
</constraint>
<index referenceId="VERTEX_SALES_ORDER_ITEM_TAX_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_ORDER_ITEM_TAX_CODE_TAX_CODE" indexType="btree">
<column name="tax_code"/>
</index>
</table>
<table name="vertex_sales_order_item_vertex_tax_code" comment="Invoice Vertex tax code from Vertex">
<column xsi:type="int" name="item_id" padding="10" nullable="false" comment="Creditmemo Item ID"/>
<column xsi:type="varchar" name="vertex_tax_code" nullable="false" length="100" comment="Invoice text code from Vertex" onCreate="migrateDataFrom(tax_code)"/>
<constraint xsi:type="unique" referenceId="UNQ_96F6BE3160A4185CEA4D866018EAF6DC">
<column name="item_id"/>
<column name="vertex_tax_code"/>
</constraint>
<index referenceId="VERTEX_SALES_ORDER_ITEM_INVOICE_TEXT_CODE_ITEM_ID" indexType="btree">
<column name="item_id"/>
</index>
<index referenceId="VERTEX_SALES_ORDER_ITEM_INVOICE_TEXT_CODE_INVOICE_TEXT_CODE" indexType="btree">
<column name="vertex_tax_code"/>
</index>
</table>
<table name="vertex_invoice_sent" onCreate="migrateVertexInvoiceSent">
<column xsi:type="int" name="invoice_id" padding="10" nullable="false" unsigned="true" comment="Invoice ID"/>
<column xsi:type="boolean" name="sent_to_vertex" nullable="false" default="0" comment="Invoice has been logged in Vertex"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="invoice_id"/>
</constraint>
</table>
<table name="sales_order_address">
<column xsi:type="varchar" name="vertex_vat_country_code" nullable="true" comment="Vertex Customer Vat Country"/>
</table>
</schema>