db_schema.xml 1.6 KB

123456789101112131415161718192021222324252627
  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="catalogsearch_recommendations" resource="default" engine="innodb"
  11. comment="Advanced Search Recommendations">
  12. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
  13. <column xsi:type="int" name="query_id" padding="10" unsigned="true" nullable="false" identity="false"
  14. default="0" comment="Query Id"/>
  15. <column xsi:type="int" name="relation_id" padding="10" unsigned="true" nullable="false" identity="false"
  16. default="0" comment="Relation Id"/>
  17. <constraint xsi:type="primary" referenceId="PRIMARY">
  18. <column name="id"/>
  19. </constraint>
  20. <constraint xsi:type="foreign" referenceId="CATALOGSEARCH_RECOMMENDATIONS_QUERY_ID_SEARCH_QUERY_QUERY_ID"
  21. table="catalogsearch_recommendations" column="query_id" referenceTable="search_query"
  22. referenceColumn="query_id" onDelete="CASCADE"/>
  23. <constraint xsi:type="foreign" referenceId="CATALOGSEARCH_RECOMMENDATIONS_RELATION_ID_SEARCH_QUERY_QUERY_ID"
  24. table="catalogsearch_recommendations" column="relation_id" referenceTable="search_query"
  25. referenceColumn="query_id" onDelete="CASCADE"/>
  26. </table>
  27. </schema>