db_schema.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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="catalogrule" resource="default" engine="innodb" comment="CatalogRule">
  11. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Entity ID"/>
  13. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  14. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  15. <column xsi:type="date" name="from_date" comment="From"/>
  16. <column xsi:type="date" name="to_date" comment="To"/>
  17. <column xsi:type="smallint" name="is_active" padding="6" unsigned="false" nullable="false" identity="false"
  18. default="0" comment="Is Active"/>
  19. <column xsi:type="mediumtext" name="conditions_serialized" nullable="true" comment="Conditions Serialized"/>
  20. <column xsi:type="mediumtext" name="actions_serialized" nullable="true" comment="Actions Serialized"/>
  21. <column xsi:type="smallint" name="stop_rules_processing" padding="6" unsigned="false" nullable="false"
  22. identity="false" default="1" comment="Stop Rules Processing"/>
  23. <column xsi:type="int" name="sort_order" padding="10" unsigned="true" nullable="false" identity="false"
  24. default="0" comment="Sort Order"/>
  25. <column xsi:type="varchar" name="simple_action" nullable="true" length="32" comment="Simple Action"/>
  26. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="false"
  27. default="0" comment="Discount Amount"/>
  28. <constraint xsi:type="primary" referenceId="PRIMARY">
  29. <column name="rule_id"/>
  30. </constraint>
  31. <index referenceId="CATALOGRULE_IS_ACTIVE_SORT_ORDER_TO_DATE_FROM_DATE" indexType="btree">
  32. <column name="is_active"/>
  33. <column name="sort_order"/>
  34. <column name="to_date"/>
  35. <column name="from_date"/>
  36. </index>
  37. </table>
  38. <table name="catalogrule_product" resource="default" engine="innodb" comment="CatalogRule Product">
  39. <column xsi:type="int" name="rule_product_id" padding="10" unsigned="true" nullable="false" identity="true"
  40. comment="Rule Product Id"/>
  41. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  42. comment="Rule ID"/>
  43. <column xsi:type="int" name="from_time" padding="10" unsigned="true" nullable="false" identity="false"
  44. default="0" comment="From Time"/>
  45. <column xsi:type="int" name="to_time" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  46. comment="To time"/>
  47. <column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="true" identity="false"/>
  48. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  49. default="0" comment="Product Id"/>
  50. <column xsi:type="varchar" name="action_operator" nullable="true" length="10" default="to_fixed"
  51. comment="Action Operator"/>
  52. <column xsi:type="decimal" name="action_amount" scale="4" precision="20" unsigned="false" nullable="false"
  53. default="0" comment="Action Amount"/>
  54. <column xsi:type="smallint" name="action_stop" padding="6" unsigned="false" nullable="false" identity="false"
  55. default="0" comment="Action Stop"/>
  56. <column xsi:type="int" name="sort_order" padding="10" unsigned="true" nullable="false" identity="false"
  57. default="0" comment="Sort Order"/>
  58. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  59. comment="Website Id"/>
  60. <constraint xsi:type="primary" referenceId="PRIMARY">
  61. <column name="rule_product_id"/>
  62. </constraint>
  63. <constraint xsi:type="unique" referenceId="UNQ_EAA51B56FF092A0DCB795D1CEF812B7B">
  64. <column name="rule_id"/>
  65. <column name="from_time"/>
  66. <column name="to_time"/>
  67. <column name="website_id"/>
  68. <column name="customer_group_id"/>
  69. <column name="product_id"/>
  70. <column name="sort_order"/>
  71. </constraint>
  72. <index referenceId="CATALOGRULE_PRODUCT_CUSTOMER_GROUP_ID" indexType="btree">
  73. <column name="customer_group_id"/>
  74. </index>
  75. <index referenceId="CATALOGRULE_PRODUCT_WEBSITE_ID" indexType="btree">
  76. <column name="website_id"/>
  77. </index>
  78. <index referenceId="CATALOGRULE_PRODUCT_FROM_TIME" indexType="btree">
  79. <column name="from_time"/>
  80. </index>
  81. <index referenceId="CATALOGRULE_PRODUCT_TO_TIME" indexType="btree">
  82. <column name="to_time"/>
  83. </index>
  84. <index referenceId="CATALOGRULE_PRODUCT_PRODUCT_ID" indexType="btree">
  85. <column name="product_id"/>
  86. </index>
  87. </table>
  88. <table name="catalogrule_product_price" resource="default" engine="innodb" comment="CatalogRule Product Price">
  89. <column xsi:type="int" name="rule_product_price_id" padding="10" unsigned="true" nullable="false"
  90. identity="true" comment="Rule Product PriceId"/>
  91. <column xsi:type="date" name="rule_date" nullable="false" comment="Rule Date"/>
  92. <column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="true" identity="false"/>
  93. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  94. default="0" comment="Product Id"/>
  95. <column xsi:type="decimal" name="rule_price" scale="4" precision="12" unsigned="false" nullable="false"
  96. default="0" comment="Rule Price"/>
  97. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  98. comment="Website Id"/>
  99. <column xsi:type="date" name="latest_start_date" comment="Latest StartDate"/>
  100. <column xsi:type="date" name="earliest_end_date" comment="Earliest EndDate"/>
  101. <constraint xsi:type="primary" referenceId="PRIMARY">
  102. <column name="rule_product_price_id"/>
  103. </constraint>
  104. <constraint xsi:type="unique" referenceId="CATRULE_PRD_PRICE_RULE_DATE_WS_ID_CSTR_GROUP_ID_PRD_ID">
  105. <column name="rule_date"/>
  106. <column name="website_id"/>
  107. <column name="customer_group_id"/>
  108. <column name="product_id"/>
  109. </constraint>
  110. <index referenceId="CATALOGRULE_PRODUCT_PRICE_CUSTOMER_GROUP_ID" indexType="btree">
  111. <column name="customer_group_id"/>
  112. </index>
  113. <index referenceId="CATALOGRULE_PRODUCT_PRICE_WEBSITE_ID" indexType="btree">
  114. <column name="website_id"/>
  115. </index>
  116. <index referenceId="CATALOGRULE_PRODUCT_PRICE_PRODUCT_ID" indexType="btree">
  117. <column name="product_id"/>
  118. </index>
  119. </table>
  120. <table name="catalogrule_group_website" resource="default" engine="innodb" comment="CatalogRule Group Website">
  121. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  122. comment="Rule ID"/>
  123. <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false"
  124. default="0" comment="Customer Group Id"/>
  125. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  126. default="0" comment="Website Id"/>
  127. <constraint xsi:type="primary" referenceId="PRIMARY">
  128. <column name="rule_id"/>
  129. <column name="customer_group_id"/>
  130. <column name="website_id"/>
  131. </constraint>
  132. <index referenceId="CATALOGRULE_GROUP_WEBSITE_CUSTOMER_GROUP_ID" indexType="btree">
  133. <column name="customer_group_id"/>
  134. </index>
  135. <index referenceId="CATALOGRULE_GROUP_WEBSITE_WEBSITE_ID" indexType="btree">
  136. <column name="website_id"/>
  137. </index>
  138. </table>
  139. <table name="catalogrule_website" resource="default" engine="innodb" comment="Catalog Rules To Websites Relations">
  140. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false"
  141. comment="Rule ID"/>
  142. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  143. comment="Website Id"/>
  144. <constraint xsi:type="primary" referenceId="PRIMARY">
  145. <column name="rule_id"/>
  146. <column name="website_id"/>
  147. </constraint>
  148. <constraint xsi:type="foreign" referenceId="CATALOGRULE_WEBSITE_RULE_ID_CATALOGRULE_RULE_ID"
  149. table="catalogrule_website" column="rule_id" referenceTable="catalogrule" referenceColumn="rule_id"
  150. onDelete="CASCADE"/>
  151. <constraint xsi:type="foreign" referenceId="CATALOGRULE_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
  152. table="catalogrule_website" column="website_id" referenceTable="store_website"
  153. referenceColumn="website_id" onDelete="CASCADE"/>
  154. <index referenceId="CATALOGRULE_WEBSITE_WEBSITE_ID" indexType="btree">
  155. <column name="website_id"/>
  156. </index>
  157. </table>
  158. <table name="catalogrule_customer_group" resource="default" engine="innodb"
  159. comment="Catalog Rules To Customer Groups Relations">
  160. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false"
  161. comment="Rule ID"/>
  162. <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false"
  163. comment="Customer Group Id"/>
  164. <constraint xsi:type="primary" referenceId="PRIMARY">
  165. <column name="rule_id"/>
  166. <column name="customer_group_id"/>
  167. </constraint>
  168. <constraint xsi:type="foreign" referenceId="CATALOGRULE_CUSTOMER_GROUP_RULE_ID_CATALOGRULE_RULE_ID"
  169. table="catalogrule_customer_group" column="rule_id" referenceTable="catalogrule"
  170. referenceColumn="rule_id" onDelete="CASCADE"/>
  171. <constraint xsi:type="foreign" referenceId="CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID"
  172. table="catalogrule_customer_group" column="customer_group_id" referenceTable="customer_group"
  173. referenceColumn="customer_group_id" onDelete="CASCADE"/>
  174. <index referenceId="CATALOGRULE_CUSTOMER_GROUP_CUSTOMER_GROUP_ID" indexType="btree">
  175. <column name="customer_group_id"/>
  176. </index>
  177. </table>
  178. <table name="catalogrule_product_replica" resource="default" engine="innodb" comment="CatalogRule Product">
  179. <column xsi:type="int" name="rule_product_id" padding="10" unsigned="true" nullable="false" identity="true"
  180. comment="Rule Product Id"/>
  181. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  182. comment="Rule ID"/>
  183. <column xsi:type="int" name="from_time" padding="10" unsigned="true" nullable="false" identity="false"
  184. default="0" comment="From Time"/>
  185. <column xsi:type="int" name="to_time" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  186. comment="To time"/>
  187. <column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="true" identity="false"/>
  188. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  189. default="0" comment="Product Id"/>
  190. <column xsi:type="varchar" name="action_operator" nullable="true" default="to_fixed" length="10"
  191. comment="Action Operator"/>
  192. <column xsi:type="decimal" name="action_amount" scale="4" precision="12" unsigned="false" nullable="false"
  193. default="0" comment="Action Amount"/>
  194. <column xsi:type="smallint" name="action_stop" padding="6" unsigned="false" nullable="false" identity="false"
  195. default="0" comment="Action Stop"/>
  196. <column xsi:type="int" name="sort_order" padding="10" unsigned="true" nullable="false" identity="false"
  197. default="0" comment="Sort Order"/>
  198. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  199. comment="Website Id"/>
  200. <constraint xsi:type="primary" referenceId="PRIMARY">
  201. <column name="rule_product_id"/>
  202. </constraint>
  203. <constraint xsi:type="unique" referenceId="UNQ_EAA51B56FF092A0DCB795D1CEF812B7B">
  204. <column name="rule_id"/>
  205. <column name="from_time"/>
  206. <column name="to_time"/>
  207. <column name="website_id"/>
  208. <column name="customer_group_id"/>
  209. <column name="product_id"/>
  210. <column name="sort_order"/>
  211. </constraint>
  212. <index referenceId="CATALOGRULE_PRODUCT_CUSTOMER_GROUP_ID" indexType="btree">
  213. <column name="customer_group_id"/>
  214. </index>
  215. <index referenceId="CATALOGRULE_PRODUCT_WEBSITE_ID" indexType="btree">
  216. <column name="website_id"/>
  217. </index>
  218. <index referenceId="CATALOGRULE_PRODUCT_FROM_TIME" indexType="btree">
  219. <column name="from_time"/>
  220. </index>
  221. <index referenceId="CATALOGRULE_PRODUCT_TO_TIME" indexType="btree">
  222. <column name="to_time"/>
  223. </index>
  224. <index referenceId="CATALOGRULE_PRODUCT_PRODUCT_ID" indexType="btree">
  225. <column name="product_id"/>
  226. </index>
  227. </table>
  228. <table name="catalogrule_product_price_replica" resource="default" engine="innodb"
  229. comment="CatalogRule Product Price">
  230. <column xsi:type="int" name="rule_product_price_id" padding="10" unsigned="true" nullable="false"
  231. identity="true" comment="Rule Product PriceId"/>
  232. <column xsi:type="date" name="rule_date" nullable="false" comment="Rule Date"/>
  233. <column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="true" identity="false"/>
  234. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  235. default="0" comment="Product Id"/>
  236. <column xsi:type="decimal" name="rule_price" scale="4" precision="12" unsigned="false" nullable="false"
  237. default="0" comment="Rule Price"/>
  238. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  239. comment="Website Id"/>
  240. <column xsi:type="date" name="latest_start_date" comment="Latest StartDate"/>
  241. <column xsi:type="date" name="earliest_end_date" comment="Earliest EndDate"/>
  242. <constraint xsi:type="primary" referenceId="PRIMARY">
  243. <column name="rule_product_price_id"/>
  244. </constraint>
  245. <constraint xsi:type="unique" referenceId="CATRULE_PRD_PRICE_RULE_DATE_WS_ID_CSTR_GROUP_ID_PRD_ID">
  246. <column name="rule_date"/>
  247. <column name="website_id"/>
  248. <column name="customer_group_id"/>
  249. <column name="product_id"/>
  250. </constraint>
  251. <index referenceId="CATALOGRULE_PRODUCT_PRICE_CUSTOMER_GROUP_ID" indexType="btree">
  252. <column name="customer_group_id"/>
  253. </index>
  254. <index referenceId="CATALOGRULE_PRODUCT_PRICE_WEBSITE_ID" indexType="btree">
  255. <column name="website_id"/>
  256. </index>
  257. <index referenceId="CATALOGRULE_PRODUCT_PRICE_PRODUCT_ID" indexType="btree">
  258. <column name="product_id"/>
  259. </index>
  260. </table>
  261. <table name="catalogrule_group_website_replica" resource="default" engine="innodb"
  262. comment="CatalogRule Group Website">
  263. <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  264. comment="Rule ID"/>
  265. <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false"
  266. default="0" comment="Customer Group Id"/>
  267. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  268. default="0" comment="Website Id"/>
  269. <constraint xsi:type="primary" referenceId="PRIMARY">
  270. <column name="rule_id"/>
  271. <column name="customer_group_id"/>
  272. <column name="website_id"/>
  273. </constraint>
  274. <index referenceId="CATALOGRULE_GROUP_WEBSITE_CUSTOMER_GROUP_ID" indexType="btree">
  275. <column name="customer_group_id"/>
  276. </index>
  277. <index referenceId="CATALOGRULE_GROUP_WEBSITE_WEBSITE_ID" indexType="btree">
  278. <column name="website_id"/>
  279. </index>
  280. </table>
  281. </schema>