File: /var/www/vhost/disk-apps/magento.bikenow.co/vendor/magento/module-product-alert/etc/db_schema.xml
<?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="product_alert_price" resource="default" engine="innodb" comment="Product Alert Price">
<column xsi:type="int" name="alert_price_id" unsigned="true" nullable="false" identity="true"
comment="Product alert price ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Customer ID"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Product ID"/>
<column xsi:type="decimal" name="price" scale="6" precision="20" unsigned="false" nullable="false" default="0"
comment="Price amount"/>
<column xsi:type="smallint" name="website_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Website ID"/>
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
default="0" comment="Store ID"/>
<column xsi:type="timestamp" name="add_date" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Product alert add date"/>
<column xsi:type="timestamp" name="last_send_date" on_update="false" nullable="true"
comment="Product alert last send date"/>
<column xsi:type="smallint" name="send_count" unsigned="true" nullable="false" identity="false"
default="0" comment="Product alert send count"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" identity="false"
default="0" comment="Product alert status"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="alert_price_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
table="product_alert_price" column="customer_id" referenceTable="customer_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
table="product_alert_price" column="product_id" referenceTable="catalog_product_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
table="product_alert_price" column="website_id" referenceTable="store_website"
referenceColumn="website_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_PRICE_STORE_ID_STORE_STORE_ID"
table="product_alert_stock" column="store_id" referenceTable="store"
referenceColumn="store_id" onDelete="CASCADE"/>
<index referenceId="PRODUCT_ALERT_PRICE_CUSTOMER_ID" indexType="btree">
<column name="customer_id"/>
</index>
<index referenceId="PRODUCT_ALERT_PRICE_PRODUCT_ID" indexType="btree">
<column name="product_id"/>
</index>
<index referenceId="PRODUCT_ALERT_PRICE_WEBSITE_ID" indexType="btree">
<column name="website_id"/>
</index>
<index referenceId="PRODUCT_ALERT_PRICE_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
</table>
<table name="product_alert_stock" resource="default" engine="innodb" comment="Product Alert Stock">
<column xsi:type="int" name="alert_stock_id" unsigned="true" nullable="false" identity="true"
comment="Product alert stock ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Customer ID"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Product ID"/>
<column xsi:type="smallint" name="website_id" unsigned="true" nullable="false" identity="false"
default="0" comment="Website ID"/>
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
default="0" comment="Store ID"/>
<column xsi:type="timestamp" name="add_date" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Product alert add date"/>
<column xsi:type="timestamp" name="send_date" on_update="false" nullable="true"
comment="Product alert send date"/>
<column xsi:type="smallint" name="send_count" unsigned="true" nullable="false" identity="false"
default="0" comment="Send Count"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" identity="false"
default="0" comment="Product alert status"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="alert_stock_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
table="product_alert_stock" column="website_id" referenceTable="store_website"
referenceColumn="website_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
table="product_alert_stock" column="customer_id" referenceTable="customer_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
table="product_alert_stock" column="product_id" referenceTable="catalog_product_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="PRODUCT_ALERT_STOCK_STORE_ID_STORE_STORE_ID"
table="product_alert_stock" column="store_id" referenceTable="store"
referenceColumn="store_id" onDelete="CASCADE"/>
<index referenceId="PRODUCT_ALERT_STOCK_CUSTOMER_ID" indexType="btree">
<column name="customer_id"/>
</index>
<index referenceId="PRODUCT_ALERT_STOCK_PRODUCT_ID" indexType="btree">
<column name="product_id"/>
</index>
<index referenceId="PRODUCT_ALERT_STOCK_WEBSITE_ID" indexType="btree">
<column name="website_id"/>
</index>
<index referenceId="PRODUCT_ALERT_STOCK_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
</table>
</schema>