db_schema.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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="wishlist" resource="default" engine="innodb" comment="Wishlist main Table">
  11. <column xsi:type="int" name="wishlist_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Wishlist 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="smallint" name="shared" padding="5" unsigned="true" nullable="false" identity="false"
  16. default="0" comment="Sharing flag (0 or 1)"/>
  17. <column xsi:type="varchar" name="sharing_code" nullable="true" length="32" comment="Sharing encrypted code"/>
  18. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Last updated date"/>
  19. <constraint xsi:type="primary" referenceId="PRIMARY">
  20. <column name="wishlist_id"/>
  21. </constraint>
  22. <constraint xsi:type="foreign" referenceId="WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="wishlist"
  23. column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id"
  24. onDelete="CASCADE"/>
  25. <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID">
  26. <column name="customer_id"/>
  27. </constraint>
  28. <index referenceId="WISHLIST_SHARED" indexType="btree">
  29. <column name="shared"/>
  30. </index>
  31. </table>
  32. <table name="wishlist_item" resource="default" engine="innodb" comment="Wishlist items">
  33. <column xsi:type="int" name="wishlist_item_id" padding="10" unsigned="true" nullable="false" identity="true"
  34. comment="Wishlist item ID"/>
  35. <column xsi:type="int" name="wishlist_id" padding="10" unsigned="true" nullable="false" identity="false"
  36. default="0" comment="Wishlist ID"/>
  37. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  38. default="0" comment="Product ID"/>
  39. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  40. comment="Store ID"/>
  41. <column xsi:type="timestamp" name="added_at" on_update="false" nullable="true" comment="Add date and time"/>
  42. <column xsi:type="text" name="description" nullable="true" comment="Short description of wish list item"/>
  43. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false"
  44. comment="Qty"/>
  45. <constraint xsi:type="primary" referenceId="PRIMARY">
  46. <column name="wishlist_item_id"/>
  47. </constraint>
  48. <constraint xsi:type="foreign" referenceId="WISHLIST_ITEM_WISHLIST_ID_WISHLIST_WISHLIST_ID" table="wishlist_item"
  49. column="wishlist_id" referenceTable="wishlist" referenceColumn="wishlist_id" onDelete="CASCADE"/>
  50. <constraint xsi:type="foreign" referenceId="WISHLIST_ITEM_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
  51. table="wishlist_item" column="product_id" referenceTable="catalog_product_entity"
  52. referenceColumn="entity_id" onDelete="CASCADE"/>
  53. <constraint xsi:type="foreign" referenceId="WISHLIST_ITEM_STORE_ID_STORE_STORE_ID" table="wishlist_item"
  54. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  55. <index referenceId="WISHLIST_ITEM_WISHLIST_ID" indexType="btree">
  56. <column name="wishlist_id"/>
  57. </index>
  58. <index referenceId="WISHLIST_ITEM_PRODUCT_ID" indexType="btree">
  59. <column name="product_id"/>
  60. </index>
  61. <index referenceId="WISHLIST_ITEM_STORE_ID" indexType="btree">
  62. <column name="store_id"/>
  63. </index>
  64. </table>
  65. <table name="wishlist_item_option" resource="default" engine="innodb" comment="Wishlist Item Option Table">
  66. <column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="true"
  67. comment="Option Id"/>
  68. <column xsi:type="int" name="wishlist_item_id" padding="10" unsigned="true" nullable="false" identity="false"
  69. comment="Wishlist Item Id"/>
  70. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  71. comment="Product Id"/>
  72. <column xsi:type="varchar" name="code" nullable="false" length="255" comment="Code"/>
  73. <column xsi:type="text" name="value" nullable="true" comment="Value"/>
  74. <constraint xsi:type="primary" referenceId="PRIMARY">
  75. <column name="option_id"/>
  76. </constraint>
  77. <constraint xsi:type="foreign" referenceId="FK_A014B30B04B72DD0EAB3EECD779728D6" table="wishlist_item_option"
  78. column="wishlist_item_id" referenceTable="wishlist_item" referenceColumn="wishlist_item_id"
  79. onDelete="CASCADE"/>
  80. </table>
  81. </schema>