db_schema.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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="persistent_session" resource="default" engine="innodb" comment="Persistent Session">
  11. <column xsi:type="int" name="persistent_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Session id"/>
  13. <column xsi:type="varchar" name="key" nullable="false" length="50" comment="Unique cookie key"/>
  14. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
  15. comment="Customer id"/>
  16. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  17. default="0" comment="Website ID"/>
  18. <column xsi:type="text" name="info" nullable="true" comment="Session Data"/>
  19. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  20. comment="Updated At"/>
  21. <constraint xsi:type="primary" referenceId="PRIMARY">
  22. <column name="persistent_id"/>
  23. </constraint>
  24. <constraint xsi:type="foreign" referenceId="PERSISTENT_SESSION_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
  25. table="persistent_session" column="customer_id" referenceTable="customer_entity"
  26. referenceColumn="entity_id" onDelete="CASCADE"/>
  27. <constraint xsi:type="foreign" referenceId="PERSISTENT_SESSION_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
  28. table="persistent_session" column="website_id" referenceTable="store_website"
  29. referenceColumn="website_id" onDelete="CASCADE"/>
  30. <constraint xsi:type="unique" referenceId="PERSISTENT_SESSION_KEY">
  31. <column name="key"/>
  32. </constraint>
  33. <constraint xsi:type="unique" referenceId="PERSISTENT_SESSION_CUSTOMER_ID">
  34. <column name="customer_id"/>
  35. </constraint>
  36. <index referenceId="PERSISTENT_SESSION_UPDATED_AT" indexType="btree">
  37. <column name="updated_at"/>
  38. </index>
  39. </table>
  40. <table name="quote" resource="checkout" comment="Sales Flat Quote">
  41. <column xsi:type="smallint" name="is_persistent" padding="5" unsigned="true" nullable="true" identity="false"
  42. default="0" comment="Is Quote Persistent"/>
  43. </table>
  44. </schema>