db_schema.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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="magento_bulk" resource="default" engine="innodb"
  11. comment="Bulk entity that represents set of related asynchronous operations">
  12. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
  13. comment="Bulk Internal ID (must not be exposed)"/>
  14. <column xsi:type="varbinary" name="uuid" nullable="true" length="39"
  15. comment="Bulk UUID (can be exposed to reference bulk entity)"/>
  16. <column xsi:type="int" name="user_id" padding="10" unsigned="true" nullable="true" identity="false"
  17. comment="ID of the WebAPI user that performed an action"/>
  18. <column xsi:type="int" name="user_type" nullable="true" comment="Which type of user"/>
  19. <column xsi:type="varchar" name="description" nullable="true" length="255" comment="Bulk Description"/>
  20. <column xsi:type="int" name="operation_count" padding="10" unsigned="true" nullable="false" identity="false"
  21. comment="Total number of operations scheduled within this bulk"/>
  22. <column xsi:type="timestamp" name="start_time" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  23. comment="Bulk start time"/>
  24. <constraint xsi:type="primary" referenceId="PRIMARY">
  25. <column name="id"/>
  26. </constraint>
  27. <constraint xsi:type="unique" referenceId="MAGENTO_BULK_UUID">
  28. <column name="uuid"/>
  29. </constraint>
  30. <index referenceId="MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID" indexType="btree">
  31. <column name="user_id"/>
  32. </index>
  33. </table>
  34. <table name="magento_operation" resource="default" engine="innodb" comment="Operation entity">
  35. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
  36. comment="Operation ID"/>
  37. <column xsi:type="varbinary" name="bulk_uuid" nullable="true" length="39" comment="Related Bulk UUID"/>
  38. <column xsi:type="varchar" name="topic_name" nullable="true" length="255"
  39. comment="Name of the related message queue topic"/>
  40. <column xsi:type="blob" name="serialized_data" nullable="true"
  41. comment="Data (serialized) required to perform an operation"/>
  42. <column xsi:type="blob" name="result_serialized_data" nullable="true"
  43. comment="Result data (serialized) after perform an operation"/>
  44. <column xsi:type="smallint" name="status" padding="6" unsigned="false" nullable="true" identity="false"
  45. default="0" comment="Operation status (OPEN | COMPLETE | RETRIABLY_FAILED | NOT_RETRIABLY_FAILED)"/>
  46. <column xsi:type="smallint" name="error_code" padding="6" unsigned="false" nullable="true" identity="false"
  47. comment="Code of the error that appeared during operation execution (used to aggregate related failed operations)"/>
  48. <column xsi:type="varchar" name="result_message" nullable="true" length="255"
  49. comment="Operation result message"/>
  50. <constraint xsi:type="primary" referenceId="PRIMARY">
  51. <column name="id"/>
  52. </constraint>
  53. <constraint xsi:type="foreign" referenceId="MAGENTO_OPERATION_BULK_UUID_MAGENTO_BULK_UUID" table="magento_operation"
  54. column="bulk_uuid" referenceTable="magento_bulk" referenceColumn="uuid" onDelete="CASCADE"/>
  55. <index referenceId="MAGENTO_OPERATION_BULK_UUID_ERROR_CODE" indexType="btree">
  56. <column name="bulk_uuid"/>
  57. <column name="error_code"/>
  58. </index>
  59. </table>
  60. <table name="magento_acknowledged_bulk" resource="default" engine="innodb"
  61. comment="Bulk that was viewed by user from notification area">
  62. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
  63. comment="Internal ID"/>
  64. <column xsi:type="varbinary" name="bulk_uuid" nullable="true" length="39" comment="Related Bulk UUID"/>
  65. <constraint xsi:type="primary" referenceId="PRIMARY">
  66. <column name="id"/>
  67. </constraint>
  68. <constraint xsi:type="foreign" referenceId="MAGENTO_ACKNOWLEDGED_BULK_BULK_UUID_MAGENTO_BULK_UUID"
  69. table="magento_acknowledged_bulk" column="bulk_uuid" referenceTable="magento_bulk"
  70. referenceColumn="uuid" onDelete="CASCADE"/>
  71. <constraint xsi:type="unique" referenceId="MAGENTO_ACKNOWLEDGED_BULK_BULK_UUID">
  72. <column name="bulk_uuid"/>
  73. </constraint>
  74. </table>
  75. </schema>