db_schema.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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="product_alert_price" resource="default" engine="innodb" comment="Product Alert Price">
  11. <column xsi:type="int" name="alert_price_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Product alert price id"/>
  13. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"
  14. default="0" comment="Customer id"/>
  15. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  16. default="0" comment="Product id"/>
  17. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  18. comment="Price amount"/>
  19. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  20. default="0" comment="Website id"/>
  21. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  22. default="0" comment="Store id"/>
  23. <column xsi:type="timestamp" name="add_date" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  24. comment="Product alert add date"/>
  25. <column xsi:type="timestamp" name="last_send_date" on_update="false" nullable="true"
  26. comment="Product alert last send date"/>
  27. <column xsi:type="smallint" name="send_count" padding="5" unsigned="true" nullable="false" identity="false"
  28. default="0" comment="Product alert send count"/>
  29. <column xsi:type="smallint" name="status" padding="5" unsigned="true" nullable="false" identity="false"
  30. default="0" comment="Product alert status"/>
  31. <constraint xsi:type="primary" referenceId="PRIMARY">
  32. <column name="alert_price_id"/>
  33. </constraint>
  34. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
  35. table="product_alert_price" column="customer_id" referenceTable="customer_entity"
  36. referenceColumn="entity_id" onDelete="CASCADE"/>
  37. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
  38. table="product_alert_price" column="product_id" referenceTable="catalog_product_entity"
  39. referenceColumn="entity_id" onDelete="CASCADE"/>
  40. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
  41. table="product_alert_price" column="website_id" referenceTable="store_website"
  42. referenceColumn="website_id" onDelete="CASCADE"/>
  43. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_STORE_ID_STORE_STORE_ID"
  44. table="product_alert_stock" column="store_id" referenceTable="store"
  45. referenceColumn="store_id" onDelete="CASCADE"/>
  46. <index referenceId="PRODUCT_ALERT_PRICE_CUSTOMER_ID" indexType="btree">
  47. <column name="customer_id"/>
  48. </index>
  49. <index referenceId="PRODUCT_ALERT_PRICE_PRODUCT_ID" indexType="btree">
  50. <column name="product_id"/>
  51. </index>
  52. <index referenceId="PRODUCT_ALERT_PRICE_WEBSITE_ID" indexType="btree">
  53. <column name="website_id"/>
  54. </index>
  55. <index referenceId="PRODUCT_ALERT_PRICE_STORE_ID" indexType="btree">
  56. <column name="store_id"/>
  57. </index>
  58. </table>
  59. <table name="product_alert_stock" resource="default" engine="innodb" comment="Product Alert Stock">
  60. <column xsi:type="int" name="alert_stock_id" padding="10" unsigned="true" nullable="false" identity="true"
  61. comment="Product alert stock id"/>
  62. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"
  63. default="0" comment="Customer id"/>
  64. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  65. default="0" comment="Product id"/>
  66. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  67. default="0" comment="Website id"/>
  68. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  69. default="0" comment="Store id"/>
  70. <column xsi:type="timestamp" name="add_date" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  71. comment="Product alert add date"/>
  72. <column xsi:type="timestamp" name="send_date" on_update="false" nullable="true"
  73. comment="Product alert send date"/>
  74. <column xsi:type="smallint" name="send_count" padding="5" unsigned="true" nullable="false" identity="false"
  75. default="0" comment="Send Count"/>
  76. <column xsi:type="smallint" name="status" padding="5" unsigned="true" nullable="false" identity="false"
  77. default="0" comment="Product alert status"/>
  78. <constraint xsi:type="primary" referenceId="PRIMARY">
  79. <column name="alert_stock_id"/>
  80. </constraint>
  81. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
  82. table="product_alert_stock" column="website_id" referenceTable="store_website"
  83. referenceColumn="website_id" onDelete="CASCADE"/>
  84. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
  85. table="product_alert_stock" column="customer_id" referenceTable="customer_entity"
  86. referenceColumn="entity_id" onDelete="CASCADE"/>
  87. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
  88. table="product_alert_stock" column="product_id" referenceTable="catalog_product_entity"
  89. referenceColumn="entity_id" onDelete="CASCADE"/>
  90. <constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_STORE_ID_STORE_STORE_ID"
  91. table="product_alert_stock" column="store_id" referenceTable="store"
  92. referenceColumn="store_id" onDelete="CASCADE"/>
  93. <index referenceId="PRODUCT_ALERT_STOCK_CUSTOMER_ID" indexType="btree">
  94. <column name="customer_id"/>
  95. </index>
  96. <index referenceId="PRODUCT_ALERT_STOCK_PRODUCT_ID" indexType="btree">
  97. <column name="product_id"/>
  98. </index>
  99. <index referenceId="PRODUCT_ALERT_STOCK_WEBSITE_ID" indexType="btree">
  100. <column name="website_id"/>
  101. </index>
  102. <index referenceId="PRODUCT_ALERT_STOCK_STORE_ID" indexType="btree">
  103. <column name="store_id"/>
  104. </index>
  105. </table>
  106. </schema>