db_schema.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/>
  13. <column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
  14. <column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/>
  15. <column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
  16. <column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
  17. unsigned="false"/>
  18. <column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
  19. <column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
  20. <column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
  21. <column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
  22. unsigned="true"/>
  23. <column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
  24. <constraint xsi:type="primary" referenceId="tinyint_primary">
  25. <column name="tinyint_ref"/>
  26. </constraint>
  27. </table>
  28. <table name="auto_increment_test" resource="default">
  29. <column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
  30. nullable="true"/>
  31. <column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
  32. unsigned="true" nullable="true"/>
  33. <constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
  34. <column name="int_auto_increment_with_nullable"/>
  35. </constraint>
  36. </table>
  37. <table name="test_table" resource="default">
  38. <!--Columns-->
  39. <column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
  40. <column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
  41. <column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
  42. <column xsi:type="float" name="float" default="0" scale="4" precision="12"/>
  43. <column xsi:type="decimal" name="double" default="11111111.111111" precision="14" scale="6"/>
  44. <column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
  45. <column xsi:type="date" name="date"/>
  46. <column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true"/>
  47. <column xsi:type="datetime" name="datetime" default="0"/>
  48. <column xsi:type="longtext" name="longtext"/>
  49. <column xsi:type="mediumtext" name="mediumtext"/>
  50. <column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
  51. <column xsi:type="mediumblob" name="mediumblob"/>
  52. <column xsi:type="blob" name="blob"/>
  53. <column xsi:type="boolean" name="boolean"/>
  54. <column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
  55. <!--Constraints-->
  56. <constraint xsi:type="unique" referenceId="TEST_TABLE_UNIQUE">
  57. <column name="smallint"/>
  58. <column name="bigint"/>
  59. </constraint>
  60. <constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE"
  61. column="tinyint" table="test_table"
  62. referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
  63. <!--Indexes-->
  64. <index referenceId="TEST_TABLE_INDEX" indexType="btree">
  65. <column name="tinyint"/>
  66. <column name="bigint"/>
  67. </index>
  68. </table>
  69. </schema>