Files

172 lines
12 KiB
XML

<!--
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="plumrocket_eav_attribute_additional" resource="default" engine="innodb" comment="Plumrocket PrivateSale EAV Attributes">
<column xsi:type="smallint" name="attribute_id" unsigned="true" nullable="false" identity="true" comment="Attribute ID"/>
<column xsi:type="smallint" name="is_global" unsigned="true" nullable="false" identity="false" comment="Is Global"/>
<column xsi:type="smallint" name="is_visible" unsigned="true" nullable="false" identity="false" comment="Is Visible"/>
<constraint xsi:type="foreign" referenceId="PLUMROCKET_EAV_ATTRIBUTE_ADDITIONAL_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
table="plumrocket_eav_attribute_additional" column="attribute_id"
referenceTable="eav_attribute" referenceColumn="attribute_id" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="attribute_id"/>
</constraint>
</table>
<table name="pr_cookie_category_entity" resource="default" engine="innodb">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Record Identifier"/>
<column xsi:type="boolean" name="status" nullable="false" comment="Status"/>
<column xsi:type="boolean" name="is_essential" nullable="false" comment="Is Essential"/>
<column xsi:type="varchar" name="key" nullable="false" length="20" comment="Category key"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="false" comment="Creation Time"/>
<column xsi:type="timestamp" name="updated_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="true" comment="Update Time"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="PR_COOKIE_CATEGORY_ENTITY_KEY">
<column name="key"/>
</constraint>
</table>
<table name="pr_cookie_entity" resource="default" engine="innodb">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Record Identifier"/>
<column xsi:type="varchar" name="category_key" nullable="false" length="20" comment="Category key"/>
<column xsi:type="varchar" name="type" nullable="false" length="10" comment="Cookie Type"/>
<column xsi:type="varchar" name="domain" nullable="true" length="255" comment="Cookie Domain"/>
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Cookie Name"/>
<column xsi:type="int" name="duration" nullable="false" comment="Cookie Duration (Lifetime)"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="false" comment="Creation Time"/>
<column xsi:type="timestamp" name="updated_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="true" comment="Update Time"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="PR_COOKIE_ENTITY_NAME">
<column name="name"/>
</constraint>
</table>
<table name="pr_cookie_category_entity_int" resource="default" engine="innodb" comment="Plumrocket Cookie Consent INT Value Table">
<column xsi:type="int" name="value_id" nullable="false" identity="true" comment="Value ID"/>
<column xsi:type="smallint" name="attribute_id" nullable="false" unsigned="true" default="0" comment="Attribute ID"/>
<column xsi:type="smallint" name="store_id" nullable="false" unsigned="true" default="0" comment="Store ID"/>
<column xsi:type="int" name="entity_id" nullable="false" unsigned="true" default="0" comment="Entity ID"/>
<column xsi:type="int" name="value" comment="Value"/>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_ENTITY_ID" indexType="btree">
<column name="entity_id"/>
</index>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_ATTRIBUTE_ID" indexType="btree">
<column name="attribute_id"/>
</index>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
<constraint xsi:type="unique" referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
<column name="entity_id"/>
<column name="attribute_id"/>
<column name="store_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
table="pr_cookie_category_entity_int" column="attribute_id"
referenceTable="eav_attribute" referenceColumn="attribute_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_ENTITY_ID"
table="pr_cookie_category_entity_int" column="entity_id"
referenceTable="pr_cookie_category_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_INT_STORE_ID"
table="pr_cookie_category_entity_int" column="store_id"
referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="value_id"/>
</constraint>
</table>
<table name="pr_cookie_category_entity_text" resource="default" engine="innodb" comment="Plumrocket Cookie Consent TEXT Value Table">
<column xsi:type="int" name="value_id" nullable="false" identity="true" comment="Value ID"/>
<column xsi:type="smallint" name="attribute_id" nullable="false" unsigned="true" default="0" comment="Attribute ID"/>
<column xsi:type="smallint" name="store_id" nullable="false" unsigned="true" default="0" comment="Store ID"/>
<column xsi:type="int" name="entity_id" nullable="false" unsigned="true" default="0" comment="Entity ID"/>
<column xsi:type="text" name="value" comment="Value"/>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_ENTITY_ID" indexType="btree">
<column name="entity_id"/>
</index>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_ATTRIBUTE_ID" indexType="btree">
<column name="attribute_id"/>
</index>
<index referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
<constraint xsi:type="unique" referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
<column name="entity_id"/>
<column name="attribute_id"/>
<column name="store_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
table="pr_cookie_category_entity_text" column="attribute_id"
referenceTable="eav_attribute" referenceColumn="attribute_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_ENTITY_ID"
table="pr_cookie_category_entity_text" column="entity_id"
referenceTable="pr_cookie_category_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_CATEGORY_ENTITY_TEXT_STORE_ID"
table="pr_cookie_category_entity_text" column="store_id"
referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="value_id"/>
</constraint>
</table>
<table name="pr_cookie_entity_text" resource="default" engine="innodb" comment="Plumrocket Cookie Consent TEXT Value Table">
<column xsi:type="int" name="value_id" nullable="false" identity="true" comment="Value ID"/>
<column xsi:type="smallint" name="attribute_id" nullable="false" unsigned="true" default="0" comment="Attribute ID"/>
<column xsi:type="smallint" name="store_id" nullable="false" unsigned="true" default="0" comment="Store ID"/>
<column xsi:type="int" name="entity_id" nullable="false" unsigned="true" default="0" comment="Entity ID"/>
<column xsi:type="text" name="value" comment="Value"/>
<index referenceId="PR_COOKIE_ENTITY_TEXT_ENTITY_ID" indexType="btree">
<column name="entity_id"/>
</index>
<index referenceId="PR_COOKIE_ENTITY_TEXT_ATTRIBUTE_ID" indexType="btree">
<column name="attribute_id"/>
</index>
<index referenceId="PR_COOKIE_ENTITY_TEXT_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
<constraint xsi:type="unique" referenceId="PR_COOKIE_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
<column name="entity_id"/>
<column name="attribute_id"/>
<column name="store_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_ENTITY_TEXT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
table="pr_cookie_entity_text" column="attribute_id"
referenceTable="eav_attribute" referenceColumn="attribute_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_ENTITY_TEXT_ENTITY_ID_PR_COOKIE_ENTITY_ID"
table="pr_cookie_entity_text" column="entity_id"
referenceTable="pr_cookie_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PR_COOKIE_ENTITY_TEXT_STORE_ID_STORE_STORE_ID"
table="pr_cookie_entity_text" column="store_id"
referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="value_id"/>
</constraint>
</table>
<table name="pr_cookie_consent_log" resource="default" engine="innodb" comment="Log of Customer Consents">
<column xsi:type="int" name="consent_id" unsigned="true" nullable="false" identity="true" comment="Record Identifier"/>
<column xsi:type="int" name="customer_id" nullable="true" unsigned="true" comment="Customer entity Id"/>
<column xsi:type="varchar" name="guest_email" nullable="true" length="254" comment="Customer and Guest Email"/>
<column xsi:type="smallint" name="website_id" nullable="false" unsigned="true" comment="Website Id"/>
<column xsi:type="varchar" name="ip_address" nullable="false" length="255" comment="Customer IP Address"/>
<column xsi:type="varchar" name="user_agent" nullable="true" length="255" comment="Customer User Agent"/>
<column xsi:type="text" name="url" nullable="true" comment="Url"/>
<column xsi:type="varchar" name="settings" nullable="false" length="255" comment="Customer Consent Settings"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="false" comment="Creation Time"/>
<index referenceId="PR_COOKIE_CONSENT_LOG_CUSTOMER_ID" indexType="btree">
<column name="customer_id"/>
</index>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="consent_id"/>
</constraint>
</table>
</schema>