<?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="autogedal_awb_error_log" resource="default" engine="innodb" comment="AWB Error Log">
        <column xsi:type="int" name="entity_id" unsigned="true" identity="true" nullable="false" comment="Entity ID"/>
        <column xsi:type="int" name="awb_id" unsigned="true" nullable="false" comment="AWB ID"/>
        <column xsi:type="int" name="order_id" unsigned="true" nullable="true" comment="Order ID"/>
        <column xsi:type="int" name="carrier_id" unsigned="true" nullable="true" comment="Carrier ID"/>
        <column xsi:type="varchar" name="carrier_code" nullable="true" length="64" comment="Carrier Code"/>
        <column xsi:type="varchar" name="carrier_label" nullable="true" length="255" comment="Carrier Label"/>
        <column xsi:type="smallint" name="attempt_count" nullable="false" default="1" comment="Attempt Count"/>
        <column xsi:type="varchar" name="status" nullable="false" length="32" default="failed" comment="Status"/>
        <column xsi:type="smallint" name="email_sent" unsigned="true" nullable="false" default="0" comment="Email Sent"/>
        <column xsi:type="varchar" name="generated_awb_number" nullable="true" length="64" comment="Generated AWB Number"/>
        <column xsi:type="timestamp" name="generated_at" nullable="true" default="NULL" comment="Generated At"/>
        <column xsi:type="text" name="last_error_message" nullable="false" comment="Last Error Message"/>
        <column xsi:type="varchar" name="last_exception_class" nullable="true" length="255" comment="Last Exception Class"/>
        <column xsi:type="text" name="request_context" nullable="true" comment="Request Context"/>
        <column xsi:type="timestamp" name="last_retry_at" nullable="true" default="NULL" comment="Last Retry At"/>
        <column xsi:type="timestamp" name="resolved_at" nullable="true" default="NULL" comment="Resolved At"/>
        <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="entity_id"/>
        </constraint>
        <index referenceId="AUTOGEDAL_AWB_ERROR_LOG_AWB_ID" indexType="btree">
            <column name="awb_id"/>
        </index>
        <index referenceId="AUTOGEDAL_AWB_ERROR_LOG_ORDER_ID" indexType="btree">
            <column name="order_id"/>
        </index>
        <index referenceId="AUTOGEDAL_AWB_ERROR_LOG_STATUS" indexType="btree">
            <column name="status"/>
        </index>
    </table>
</schema>
