db_schema.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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="cataloginventory_stock" resource="default" engine="innodb" comment="Cataloginventory Stock">
  11. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="true"
  12. comment="Stock Id"/>
  13. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  14. comment="Website Id"/>
  15. <column xsi:type="varchar" name="stock_name" nullable="true" length="255" comment="Stock Name"/>
  16. <constraint xsi:type="primary" referenceId="PRIMARY">
  17. <column name="stock_id"/>
  18. </constraint>
  19. <index referenceId="CATALOGINVENTORY_STOCK_WEBSITE_ID" indexType="btree">
  20. <column name="website_id"/>
  21. </index>
  22. </table>
  23. <table name="cataloginventory_stock_item" resource="default" engine="innodb" comment="Cataloginventory Stock Item">
  24. <column xsi:type="int" name="item_id" padding="10" unsigned="true" nullable="false" identity="true"
  25. comment="Item Id"/>
  26. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  27. default="0" comment="Product Id"/>
  28. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
  29. default="0" comment="Stock Id"/>
  30. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="true" comment="Qty"/>
  31. <column xsi:type="decimal" name="min_qty" scale="4" precision="12" unsigned="false" nullable="false"
  32. default="0" comment="Min Qty"/>
  33. <column xsi:type="smallint" name="use_config_min_qty" padding="5" unsigned="true" nullable="false"
  34. identity="false" default="1" comment="Use Config Min Qty"/>
  35. <column xsi:type="smallint" name="is_qty_decimal" padding="5" unsigned="true" nullable="false" identity="false"
  36. default="0" comment="Is Qty Decimal"/>
  37. <column xsi:type="smallint" name="backorders" padding="5" unsigned="true" nullable="false" identity="false"
  38. default="0" comment="Backorders"/>
  39. <column xsi:type="smallint" name="use_config_backorders" padding="5" unsigned="true" nullable="false"
  40. identity="false" default="1" comment="Use Config Backorders"/>
  41. <column xsi:type="decimal" name="min_sale_qty" scale="4" precision="12" unsigned="false" nullable="false"
  42. default="1" comment="Min Sale Qty"/>
  43. <column xsi:type="smallint" name="use_config_min_sale_qty" padding="5" unsigned="true" nullable="false"
  44. identity="false" default="1" comment="Use Config Min Sale Qty"/>
  45. <column xsi:type="decimal" name="max_sale_qty" scale="4" precision="12" unsigned="false" nullable="false"
  46. default="0" comment="Max Sale Qty"/>
  47. <column xsi:type="smallint" name="use_config_max_sale_qty" padding="5" unsigned="true" nullable="false"
  48. identity="false" default="1" comment="Use Config Max Sale Qty"/>
  49. <column xsi:type="smallint" name="is_in_stock" padding="5" unsigned="true" nullable="false" identity="false"
  50. default="0" comment="Is In Stock"/>
  51. <column xsi:type="timestamp" name="low_stock_date" on_update="false" nullable="true" comment="Low Stock Date"/>
  52. <column xsi:type="decimal" name="notify_stock_qty" scale="4" precision="12" unsigned="false" nullable="true"
  53. comment="Notify Stock Qty"/>
  54. <column xsi:type="smallint" name="use_config_notify_stock_qty" padding="5" unsigned="true" nullable="false"
  55. identity="false" default="1" comment="Use Config Notify Stock Qty"/>
  56. <column xsi:type="smallint" name="manage_stock" padding="5" unsigned="true" nullable="false" identity="false"
  57. default="0" comment="Manage Stock"/>
  58. <column xsi:type="smallint" name="use_config_manage_stock" padding="5" unsigned="true" nullable="false"
  59. identity="false" default="1" comment="Use Config Manage Stock"/>
  60. <column xsi:type="smallint" name="stock_status_changed_auto" padding="5" unsigned="true" nullable="false"
  61. identity="false" default="0" comment="Stock Status Changed Automatically"/>
  62. <column xsi:type="smallint" name="use_config_qty_increments" padding="5" unsigned="true" nullable="false"
  63. identity="false" default="1" comment="Use Config Qty Increments"/>
  64. <column xsi:type="decimal" name="qty_increments" scale="4" precision="12" unsigned="false" nullable="false"
  65. default="0" comment="Qty Increments"/>
  66. <column xsi:type="smallint" name="use_config_enable_qty_inc" padding="5" unsigned="true" nullable="false"
  67. identity="false" default="1" comment="Use Config Enable Qty Increments"/>
  68. <column xsi:type="smallint" name="enable_qty_increments" padding="5" unsigned="true" nullable="false"
  69. identity="false" default="0" comment="Enable Qty Increments"/>
  70. <column xsi:type="smallint" name="is_decimal_divided" padding="5" unsigned="true" nullable="false"
  71. identity="false" default="0" comment="Is Divided into Multiple Boxes for Shipping"/>
  72. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  73. default="0" comment="Website ID"/>
  74. <constraint xsi:type="primary" referenceId="PRIMARY">
  75. <column name="item_id"/>
  76. </constraint>
  77. <constraint xsi:type="foreign" referenceId="CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
  78. table="cataloginventory_stock_item" column="product_id" referenceTable="catalog_product_entity"
  79. referenceColumn="entity_id" onDelete="CASCADE"/>
  80. <constraint xsi:type="foreign" referenceId="CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID"
  81. table="cataloginventory_stock_item" column="stock_id" referenceTable="cataloginventory_stock"
  82. referenceColumn="stock_id" onDelete="CASCADE"/>
  83. <constraint xsi:type="unique" referenceId="CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID">
  84. <column name="product_id"/>
  85. <column name="stock_id"/>
  86. </constraint>
  87. <index referenceId="CATALOGINVENTORY_STOCK_ITEM_WEBSITE_ID" indexType="btree">
  88. <column name="website_id"/>
  89. </index>
  90. <index referenceId="CATALOGINVENTORY_STOCK_ITEM_STOCK_ID" indexType="btree">
  91. <column name="stock_id"/>
  92. </index>
  93. </table>
  94. <table name="cataloginventory_stock_status" resource="default" engine="innodb"
  95. comment="Cataloginventory Stock Status">
  96. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  97. comment="Product Id"/>
  98. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  99. comment="Website Id"/>
  100. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
  101. comment="Stock Id"/>
  102. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  103. comment="Qty"/>
  104. <column xsi:type="smallint" name="stock_status" padding="5" unsigned="true" nullable="false" identity="false"
  105. comment="Stock Status"/>
  106. <constraint xsi:type="primary" referenceId="PRIMARY">
  107. <column name="product_id"/>
  108. <column name="website_id"/>
  109. <column name="stock_id"/>
  110. </constraint>
  111. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_STOCK_ID" indexType="btree">
  112. <column name="stock_id"/>
  113. </index>
  114. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_WEBSITE_ID" indexType="btree">
  115. <column name="website_id"/>
  116. </index>
  117. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_STOCK_STATUS" indexType="btree">
  118. <column name="stock_status"/>
  119. </index>
  120. </table>
  121. <table name="cataloginventory_stock_status_idx" resource="default" engine="innodb"
  122. comment="Cataloginventory Stock Status Indexer Idx">
  123. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  124. comment="Product Id"/>
  125. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  126. comment="Website Id"/>
  127. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
  128. comment="Stock Id"/>
  129. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  130. comment="Qty"/>
  131. <column xsi:type="smallint" name="stock_status" padding="5" unsigned="true" nullable="false" identity="false"
  132. comment="Stock Status"/>
  133. <constraint xsi:type="primary" referenceId="PRIMARY">
  134. <column name="product_id"/>
  135. <column name="website_id"/>
  136. <column name="stock_id"/>
  137. </constraint>
  138. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_IDX_STOCK_ID" indexType="btree">
  139. <column name="stock_id"/>
  140. </index>
  141. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_IDX_WEBSITE_ID" indexType="btree">
  142. <column name="website_id"/>
  143. </index>
  144. </table>
  145. <table name="cataloginventory_stock_status_tmp" resource="default" engine="memory"
  146. comment="Cataloginventory Stock Status Indexer Tmp">
  147. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  148. comment="Product Id"/>
  149. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  150. comment="Website Id"/>
  151. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
  152. comment="Stock Id"/>
  153. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  154. comment="Qty"/>
  155. <column xsi:type="smallint" name="stock_status" padding="5" unsigned="true" nullable="false" identity="false"
  156. comment="Stock Status"/>
  157. <constraint xsi:type="primary" referenceId="PRIMARY">
  158. <column name="product_id"/>
  159. <column name="website_id"/>
  160. <column name="stock_id"/>
  161. </constraint>
  162. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_TMP_STOCK_ID" indexType="hash">
  163. <column name="stock_id"/>
  164. </index>
  165. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_TMP_WEBSITE_ID" indexType="hash">
  166. <column name="website_id"/>
  167. </index>
  168. </table>
  169. <table name="cataloginventory_stock_status_replica" resource="default" engine="innodb"
  170. comment="Cataloginventory Stock Status">
  171. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  172. comment="Product Id"/>
  173. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  174. comment="Website Id"/>
  175. <column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
  176. comment="Stock Id"/>
  177. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  178. comment="Qty"/>
  179. <column xsi:type="smallint" name="stock_status" padding="5" unsigned="true" nullable="false" identity="false"
  180. comment="Stock Status"/>
  181. <constraint xsi:type="primary" referenceId="PRIMARY">
  182. <column name="product_id"/>
  183. <column name="website_id"/>
  184. <column name="stock_id"/>
  185. </constraint>
  186. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_STOCK_ID" indexType="btree">
  187. <column name="stock_id"/>
  188. </index>
  189. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_WEBSITE_ID" indexType="btree">
  190. <column name="website_id"/>
  191. </index>
  192. <index referenceId="CATALOGINVENTORY_STOCK_STATUS_STOCK_STATUS" indexType="btree">
  193. <column name="stock_status"/>
  194. </index>
  195. </table>
  196. </schema>