<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2023 Amasty (https://www.amasty.com)
 * @package Order Status for Magento 2
 */-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  <table name="amasty_orderstatus_status" resource="default" engine="innodb" comment="amasty_orderstatus_status">
    <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
    <column xsi:type="varchar" name="alias" nullable="false" length="255" comment="Alias"/>
    <column xsi:type="varchar" name="status" nullable="false" length="255" comment="Status"/>
    <column xsi:type="varchar" name="parent_state" nullable="false" length="255" comment="Parent State"/>
    <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Is Active"/>
    <column xsi:type="smallint" name="is_system" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Is System"/>
    <column xsi:type="smallint" name="notify_by_email" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Notify By Email"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="id"/>
    </constraint>
  </table>
  <table name="amasty_orderstatus_status_template" resource="default" engine="innodb" comment="amasty_orderstatus_status_template">
    <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
    <column xsi:type="int" name="status_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Status Id"/>
    <column xsi:type="int" name="store_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Store Id"/>
    <column xsi:type="int" name="template_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Template Id"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="id"/>
    </constraint>
    <index referenceId="STATUS_ID" indexType="btree">
      <column name="status_id"/>
      <column name="store_id"/>
    </index>
  </table>
</schema>
