db_schema.xml 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  10. <table name="reference_table" resource="default">
  11. <column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
  12. <column xsi:type="int" name="some_integer" default="0" nullable="false" unsigned="false"/>
  13. <column xsi:type="varchar" name="for_patch_testing" comment="For patch testing" />
  14. <constraint xsi:type="primary" referenceId="tinyint_primary">
  15. <column name="tinyint_ref"/>
  16. </constraint>
  17. </table>
  18. <table name="test_table" resource="default">
  19. <!--Columns-->
  20. <column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
  21. <column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
  22. <column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
  23. <column xsi:type="varbinary" name="varbinary" default="10101" />
  24. <constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
  25. column="tinyint" table="test_table"
  26. referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="CASCADE"/>
  27. <constraint xsi:type="primary" referenceId="PRIMARY">
  28. <column name="smallint" />
  29. </constraint>
  30. </table>
  31. </schema>