db_schema.xml 1.7 KB

123456789101112131415161718192021222324252627282930
  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="googleoptimizer_code" resource="default" engine="innodb" comment="Google Experiment code">
  11. <column xsi:type="int" name="code_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Google experiment code id"/>
  13. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  14. comment="Optimized entity id product id or catalog id"/>
  15. <column xsi:type="varchar" name="entity_type" nullable="true" length="50" comment="Optimized entity type"/>
  16. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  17. comment="Store id"/>
  18. <column xsi:type="text" name="experiment_script" nullable="true" comment="Google experiment script"/>
  19. <constraint xsi:type="primary" referenceId="PRIMARY">
  20. <column name="code_id"/>
  21. </constraint>
  22. <constraint xsi:type="foreign" referenceId="GOOGLEOPTIMIZER_CODE_STORE_ID_STORE_STORE_ID" table="googleoptimizer_code"
  23. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  24. <constraint xsi:type="unique" referenceId="GOOGLEOPTIMIZER_CODE_STORE_ID_ENTITY_ID_ENTITY_TYPE">
  25. <column name="store_id"/>
  26. <column name="entity_id"/>
  27. <column name="entity_type"/>
  28. </constraint>
  29. </table>
  30. </schema>