123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <?xml version="1.0"?>
- <!--
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- -->
- <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
- <table name="report_compared_product_index" resource="default" engine="innodb"
- comment="Reports Compared Product Index Table">
- <column xsi:type="bigint" name="index_id" padding="20" unsigned="true" nullable="false" identity="true"
- comment="Index Id"/>
- <column xsi:type="int" name="visitor_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Visitor Id"/>
- <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Customer Id"/>
- <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
- comment="Product Id"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
- comment="Store Id"/>
- <column xsi:type="timestamp" name="added_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
- comment="Added At"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="index_id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_CMPD_PRD_IDX_CSTR_ID_CSTR_ENTT_ENTT_ID"
- table="report_compared_product_index" column="customer_id" referenceTable="customer_entity"
- referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_CMPD_PRD_IDX_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
- table="report_compared_product_index" column="product_id" referenceTable="catalog_product_entity"
- referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_COMPARED_PRODUCT_INDEX_STORE_ID_STORE_STORE_ID"
- table="report_compared_product_index" column="store_id" referenceTable="store"
- referenceColumn="store_id" onDelete="SET NULL"/>
- <constraint xsi:type="unique" referenceId="REPORT_COMPARED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID">
- <column name="visitor_id"/>
- <column name="product_id"/>
- </constraint>
- <constraint xsi:type="unique" referenceId="REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID">
- <column name="customer_id"/>
- <column name="product_id"/>
- </constraint>
- <index referenceId="REPORT_COMPARED_PRODUCT_INDEX_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- <index referenceId="REPORT_COMPARED_PRODUCT_INDEX_ADDED_AT" indexType="btree">
- <column name="added_at"/>
- </index>
- <index referenceId="REPORT_COMPARED_PRODUCT_INDEX_PRODUCT_ID" indexType="btree">
- <column name="product_id"/>
- </index>
- </table>
- <table name="report_viewed_product_index" resource="default" engine="innodb"
- comment="Reports Viewed Product Index Table">
- <column xsi:type="bigint" name="index_id" padding="20" unsigned="true" nullable="false" identity="true"
- comment="Index Id"/>
- <column xsi:type="int" name="visitor_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Visitor Id"/>
- <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Customer Id"/>
- <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
- comment="Product Id"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
- comment="Store Id"/>
- <column xsi:type="timestamp" name="added_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
- comment="Added At"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="index_id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRD_IDX_CSTR_ID_CSTR_ENTT_ENTT_ID"
- table="report_viewed_product_index" column="customer_id" referenceTable="customer_entity"
- referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRD_IDX_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
- table="report_viewed_product_index" column="product_id" referenceTable="catalog_product_entity"
- referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRODUCT_INDEX_STORE_ID_STORE_STORE_ID"
- table="report_viewed_product_index" column="store_id" referenceTable="store"
- referenceColumn="store_id" onDelete="SET NULL"/>
- <constraint xsi:type="unique" referenceId="REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID">
- <column name="visitor_id"/>
- <column name="product_id"/>
- </constraint>
- <constraint xsi:type="unique" referenceId="REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID">
- <column name="customer_id"/>
- <column name="product_id"/>
- </constraint>
- <index referenceId="REPORT_VIEWED_PRODUCT_INDEX_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- <index referenceId="REPORT_VIEWED_PRODUCT_INDEX_ADDED_AT" indexType="btree">
- <column name="added_at"/>
- </index>
- <index referenceId="REPORT_VIEWED_PRODUCT_INDEX_PRODUCT_ID" indexType="btree">
- <column name="product_id"/>
- </index>
- </table>
- <table name="report_event_types" resource="default" engine="innodb" comment="Reports Event Type Table">
- <column xsi:type="smallint" name="event_type_id" padding="5" unsigned="true" nullable="false" identity="true"
- comment="Event Type Id"/>
- <column xsi:type="varchar" name="event_name" nullable="false" length="64" comment="Event Name"/>
- <column xsi:type="smallint" name="customer_login" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Customer Login"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="event_type_id"/>
- </constraint>
- </table>
- <table name="report_event" resource="default" engine="innodb" comment="Reports Event Table">
- <column xsi:type="bigint" name="event_id" padding="20" unsigned="true" nullable="false" identity="true"
- comment="Event Id"/>
- <column xsi:type="timestamp" name="logged_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
- comment="Logged At"/>
- <column xsi:type="smallint" name="event_type_id" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Event Type Id"/>
- <column xsi:type="int" name="object_id" padding="10" unsigned="true" nullable="false" identity="false"
- default="0" comment="Object Id"/>
- <column xsi:type="int" name="subject_id" padding="10" unsigned="true" nullable="false" identity="false"
- default="0" comment="Subject Id"/>
- <column xsi:type="smallint" name="subtype" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Subtype"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
- comment="Store Id"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="event_id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_EVENT_STORE_ID_STORE_STORE_ID" table="report_event"
- column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_EVENT_EVENT_TYPE_ID_REPORT_EVENT_TYPES_EVENT_TYPE_ID"
- table="report_event" column="event_type_id" referenceTable="report_event_types"
- referenceColumn="event_type_id" onDelete="CASCADE"/>
- <index referenceId="REPORT_EVENT_EVENT_TYPE_ID" indexType="btree">
- <column name="event_type_id"/>
- </index>
- <index referenceId="REPORT_EVENT_SUBJECT_ID" indexType="btree">
- <column name="subject_id"/>
- </index>
- <index referenceId="REPORT_EVENT_OBJECT_ID" indexType="btree">
- <column name="object_id"/>
- </index>
- <index referenceId="REPORT_EVENT_SUBTYPE" indexType="btree">
- <column name="subtype"/>
- </index>
- <index referenceId="REPORT_EVENT_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- </table>
- <table name="report_viewed_product_aggregated_daily" resource="default" engine="innodb"
- comment="Most Viewed Products Aggregated Daily">
- <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
- <column xsi:type="date" name="period" comment="Period"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
- comment="Store Id"/>
- <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Product Id"/>
- <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
- <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
- default="0" comment="Product Price"/>
- <column xsi:type="int" name="views_num" padding="11" unsigned="false" nullable="false" identity="false"
- default="0" comment="Number of Views"/>
- <column xsi:type="smallint" name="rating_pos" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Rating Pos"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID_STORE_STORE_ID"
- table="report_viewed_product_aggregated_daily" column="store_id" referenceTable="store"
- referenceColumn="store_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRD_AGGRED_DAILY_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
- table="report_viewed_product_aggregated_daily" column="product_id"
- referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="unique" referenceId="REPORT_VIEWED_PRD_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID">
- <column name="period"/>
- <column name="store_id"/>
- <column name="product_id"/>
- </constraint>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_PRODUCT_ID" indexType="btree">
- <column name="product_id"/>
- </index>
- </table>
- <table name="report_viewed_product_aggregated_monthly" resource="default" engine="innodb"
- comment="Most Viewed Products Aggregated Monthly">
- <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
- <column xsi:type="date" name="period" comment="Period"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
- comment="Store Id"/>
- <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Product Id"/>
- <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
- <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
- default="0" comment="Product Price"/>
- <column xsi:type="int" name="views_num" padding="11" unsigned="false" nullable="false" identity="false"
- default="0" comment="Number of Views"/>
- <column xsi:type="smallint" name="rating_pos" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Rating Pos"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_STORE_ID_STORE_STORE_ID"
- table="report_viewed_product_aggregated_monthly" column="store_id" referenceTable="store"
- referenceColumn="store_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRD_AGGRED_MONTHLY_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
- table="report_viewed_product_aggregated_monthly" column="product_id"
- referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="unique" referenceId="REPORT_VIEWED_PRD_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID">
- <column name="period"/>
- <column name="store_id"/>
- <column name="product_id"/>
- </constraint>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_PRODUCT_ID" indexType="btree">
- <column name="product_id"/>
- </index>
- </table>
- <table name="report_viewed_product_aggregated_yearly" resource="default" engine="innodb"
- comment="Most Viewed Products Aggregated Yearly">
- <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
- <column xsi:type="date" name="period" comment="Period"/>
- <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
- comment="Store Id"/>
- <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="true" identity="false"
- comment="Product Id"/>
- <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
- <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
- default="0" comment="Product Price"/>
- <column xsi:type="int" name="views_num" padding="11" unsigned="false" nullable="false" identity="false"
- default="0" comment="Number of Views"/>
- <column xsi:type="smallint" name="rating_pos" padding="5" unsigned="true" nullable="false" identity="false"
- default="0" comment="Rating Pos"/>
- <constraint xsi:type="primary" referenceId="PRIMARY">
- <column name="id"/>
- </constraint>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_STORE_ID_STORE_STORE_ID"
- table="report_viewed_product_aggregated_yearly" column="store_id" referenceTable="store"
- referenceColumn="store_id" onDelete="CASCADE"/>
- <constraint xsi:type="foreign" referenceId="REPORT_VIEWED_PRD_AGGRED_YEARLY_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
- table="report_viewed_product_aggregated_yearly" column="product_id"
- referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
- <constraint xsi:type="unique" referenceId="REPORT_VIEWED_PRD_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID">
- <column name="period"/>
- <column name="store_id"/>
- <column name="product_id"/>
- </constraint>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_STORE_ID" indexType="btree">
- <column name="store_id"/>
- </index>
- <index referenceId="REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_PRODUCT_ID" indexType="btree">
- <column name="product_id"/>
- </index>
- </table>
- </schema>
|