db_schema.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License").
  7. * You may not use this file except in compliance with the License.
  8. * A copy of the License is located at
  9. *
  10. * http://aws.amazon.com/apache2.0
  11. *
  12. * or in the "license" file accompanying this file. This file is distributed
  13. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  14. * express or implied. See the License for the specific language governing
  15. * permissions and limitations under the License.
  16. */
  17. -->
  18. <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19. xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  20. <table name="amazon_quote" resource="checkout" engine="innodb" comment="amazon_quote">
  21. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
  22. <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Quote ID"/>
  23. <column xsi:type="varchar" name="amazon_order_reference_id" nullable="false" length="255" comment="Amazon Order Reference ID"/>
  24. <column xsi:type="varchar" name="sandbox_simulation_reference" nullable="true" length="255" comment="Sandbox simulation reference"/>
  25. <column xsi:type="smallint" name="confirmed" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Quote confirmed with Amazon"/>
  26. <constraint xsi:type="primary" referenceId="PRIMARY">
  27. <column name="entity_id"/>
  28. </constraint>
  29. <constraint xsi:type="foreign" referenceId="AMAZON_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID" table="amazon_quote" column="quote_id" referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/>
  30. <constraint xsi:type="unique" referenceId="AMAZON_QUOTE_QUOTE_ID">
  31. <column name="quote_id"/>
  32. </constraint>
  33. </table>
  34. <table name="amazon_sales_order" resource="sales" engine="innodb" comment="amazon_sales_order">
  35. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
  36. <column xsi:type="int" name="order_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Order ID"/>
  37. <column xsi:type="varchar" name="amazon_order_reference_id" nullable="false" length="255" comment="Amazon Order Reference ID"/>
  38. <constraint xsi:type="primary" referenceId="PRIMARY">
  39. <column name="entity_id"/>
  40. </constraint>
  41. <constraint xsi:type="foreign" referenceId="AMAZON_SALES_ORDER_ORDER_ID_SALES_ORDER_ENTITY_ID" table="amazon_sales_order" column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
  42. <constraint xsi:type="unique" referenceId="AMAZON_SALES_ORDER_ORDER_ID">
  43. <column name="order_id"/>
  44. </constraint>
  45. </table>
  46. </schema>