<?xml version="1.0"?>
<!--
/**
 * @copyright: Copyright © 2021 Firebear Studio. All rights reserved.
 * @author   : Firebear Studio <fbeardev@gmail.com>
 */
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="firebear_queue_log" resource="default"
           engine="innodb" comment="Queue Log Table" charset="utf8" collation="utf8_general_ci">
        <column xsi:type="int" name="log_id" padding="11" unsigned="true" nullable="false" identity="true"
                comment="Log ID"/>
        <column xsi:type="varchar" name="entity" nullable="false" length="255" comment="Entity"/>
        <column xsi:type="int" name="entity_id" unsigned="true" nullable="true" identity="false"
                comment="Entity Id"/>
        <column xsi:type="text" name="result" nullable="false" comment="Result"/>
        <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"/>
        <column xsi:type="smallint" name="status" padding="5" unsigned="true" nullable="false" identity="false"
                default="1" comment="Status"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="log_id"/>
        </constraint>
    </table>
    <table name="sales_order" resource="sales" comment="Sales Flat Order">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
        <column xsi:type="varchar" name="sap_status" nullable="true" comment="Sap Status"/>
    </table>
    <table name="sales_invoice" resource="sales" comment="Sales Flat Invoice">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
        <column xsi:type="varchar" name="sap_payment_id" nullable="true" comment="Sap Payment ID"/>
    </table>
    <table name="sales_shipment" resource="sales" comment="Sales Flat Shipment">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
    </table>
    <table name="sales_creditmemo" resource="sales" comment="Sales Flat Creditmemo">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
    </table>
    <table name="customer_group" resource="sales" comment="Customer Group">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
    </table>
    <table name="catalogrule" resource="sales" comment="CatalogRule">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
    </table>
    <table name="salesrule" resource="sales" comment="Salesrule">
        <column xsi:type="varchar" name="sap_id" nullable="true" comment="Sap ID"/>
    </table>
</schema>