forked from NVision-Commerce-Solutions/module-customer-price
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_schema.xml
38 lines (37 loc) · 2.74 KB
/
db_schema.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="commerce365_cached_price" resource="default" engine="innodb" comment="Commerce365 Prices Table">
<column xsi:type="bigint" name="id" padding="20" unsigned="true" nullable="false" identity="true" comment="Id"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false" comment="Product Id"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="true" identity="false" comment="Customer Id"/>
<column xsi:type="text" name="price_data" nullable="false" comment="Price Data"/>
<column xsi:type="timestamp" name="last_updated" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Last Updated"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id"/>
</constraint>
<constraint xsi:type="unique" referenceId="UNIQUE_PAIR">
<column name="product_id"/>
<column name="customer_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="COMMERCE365_CACHED_PRICE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
table="commerce365_cached_price" column="customer_id" referenceTable="customer_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="LSWF_CACHED_PRICE_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
table="commerce365_cached_price" column="product_id" referenceTable="catalog_product_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
</table>
<table name="commerce365_customer_price_token" resource="default" engine="innodb" comment="Commerce365 Customer Token Table">
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="Id"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="true" identity="false" comment="Customer Id"/>
<column xsi:type="varchar" name="token" nullable="true" length="128" comment="Customer token"/>
<constraint xsi:type="foreign" referenceId="COMMERCE365_CUSTOMER_PRICE_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
table="commerce365_customer_price_token" column="customer_id" referenceTable="customer_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="UNIQUE_CUSTOMER_ID">
<column name="customer_id"/>
</constraint>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id"/>
</constraint>
</table>
</schema>