db_schema.xml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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="sales_sequence_profile" resource="sales" engine="innodb" comment="sales_sequence_profile" onCreate="skip-migration">
  11. <column xsi:type="int" name="profile_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Id"/>
  13. <column xsi:type="int" name="meta_id" padding="10" unsigned="true" nullable="false" identity="false"
  14. comment="Meta_id"/>
  15. <column xsi:type="varchar" name="prefix" nullable="true" length="32" comment="Prefix"/>
  16. <column xsi:type="varchar" name="suffix" nullable="true" length="32" comment="Suffix"/>
  17. <column xsi:type="int" name="start_value" padding="10" unsigned="true" nullable="false" identity="false"
  18. default="1" comment="Start value for sequence"/>
  19. <column xsi:type="int" name="step" padding="10" unsigned="true" nullable="false" identity="false" default="1"
  20. comment="Step for sequence"/>
  21. <column xsi:type="int" name="max_value" padding="10" unsigned="true" nullable="false" identity="false"
  22. comment="MaxValue for sequence"/>
  23. <column xsi:type="int" name="warning_value" padding="10" unsigned="true" nullable="false" identity="false"
  24. comment="WarningValue for sequence"/>
  25. <column xsi:type="boolean" name="is_active" nullable="false" default="false" comment="isActive flag"/>
  26. <constraint xsi:type="primary" referenceId="PRIMARY">
  27. <column name="profile_id"/>
  28. </constraint>
  29. <constraint xsi:type="foreign" referenceId="SALES_SEQUENCE_PROFILE_META_ID_SALES_SEQUENCE_META_META_ID"
  30. table="sales_sequence_profile" column="meta_id" referenceTable="sales_sequence_meta"
  31. referenceColumn="meta_id" onDelete="CASCADE"/>
  32. <constraint xsi:type="unique" referenceId="SALES_SEQUENCE_PROFILE_META_ID_PREFIX_SUFFIX">
  33. <column name="meta_id"/>
  34. <column name="prefix"/>
  35. <column name="suffix"/>
  36. </constraint>
  37. </table>
  38. <table name="sales_sequence_meta" resource="sales" engine="innodb" comment="sales_sequence_meta" onCreate="skip-migration">
  39. <column xsi:type="int" name="meta_id" padding="10" unsigned="true" nullable="false" identity="true"
  40. comment="Id"/>
  41. <column xsi:type="varchar" name="entity_type" nullable="false" length="32" comment="Prefix"/>
  42. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  43. comment="Store Id"/>
  44. <column xsi:type="varchar" name="sequence_table" nullable="false" length="64" comment="table for sequence"/>
  45. <constraint xsi:type="primary" referenceId="PRIMARY">
  46. <column name="meta_id"/>
  47. </constraint>
  48. <constraint xsi:type="unique" referenceId="SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID">
  49. <column name="entity_type"/>
  50. <column name="store_id"/>
  51. </constraint>
  52. </table>
  53. </schema>