<?xml version="1.0"?>
<!--
 * @package     Plumrocket_Estimateddelivery
 * @copyright   Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
 * @license     https://plumrocket.com/license/  End-user License Agreement
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="plumrocket_estimateddelivery_order_item" resource="default" engine="innodb" comment="Estimated Delivery Order Item">
        <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
        <column xsi:type="int" name="item_id" padding="10" unsigned="true" nullable="false" comment="Order Item Id"/>
        <column xsi:type="text" name="delivery" nullable="true" comment="Estimated Delivery"/>
        <column xsi:type="text" name="shipping" nullable="true" comment="Estimated Shipping"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="id"/>
        </constraint>
        <constraint xsi:type="unique" referenceId="PLUMROCKET_ESTIMATEDDELIVERY_ORDER_ITEM_ITEM_ID">
            <column name="item_id"/>
        </constraint>
        <constraint xsi:type="foreign"
                    referenceId="PLUMROCKET_ESTIMATEDDELIVERY_ORDER_ITEM_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID"
                    table="plumrocket_estimateddelivery_order_item"
                    column="item_id"
                    referenceTable="sales_order_item"
                    referenceColumn="item_id"
                    onDelete="CASCADE"
        />
    </table>
</schema>
