<?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="wishlist" resource="default">
        <column xsi:type="varchar" name="wishlist_name" nullable="true" length="255" default="My Wish List" comment="Wish List Name"/>
        <column xsi:type="boolean" name="disable_share" nullable="false" default="0" comment="Disable Share"/>
        <column xsi:type="boolean" name="disable_price_alert" nullable="false" default="0" comment="Disable Price Alert"/>
        <column xsi:type="boolean" name="disable_public" nullable="false" default="0" comment="Disable Public"/>
        <constraint xsi:type="foreign" referenceId="WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="wishlist"
                    column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id"
                    onDelete="CASCADE"/>
        <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID" disabled="true"/>
        <index referenceId="WISHLIST_CUSTOMER_ID" indexType="btree">
            <column name="customer_id"/>
        </index>
    </table>
    <table name="wishlist_product_alert_price" resource="default" engine="innodb" comment="Wishlist Product Alert Price">
        <column xsi:type="int" name="alert_id" padding="10" unsigned="true" nullable="false" identity="true"
                comment="Alert Id"/>
        <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"
                default="0" comment="Customer id"/>
        <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
                default="0" comment="Product id"/>
        <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="false" default="0"
                comment="Price amount"/>
        <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
                default="0" comment="Website id"/>
        <column xsi:type="int" name="wishlist_id" padding="10" unsigned="true" nullable="false" identity="false"
                default="0" comment="Wishlist id"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="alert_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="WISHLIST_PRODUCT_ALERT_PRICE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
                    table="wishlist_product_alert_price" column="customer_id" referenceTable="customer_entity"
                    referenceColumn="entity_id" onDelete="CASCADE"/>
        <constraint xsi:type="foreign" referenceId="WISHLIST_PRODUCT_ALERT_PRICE_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID"
                    table="wishlist_product_alert_price" column="product_id" referenceTable="catalog_product_entity"
                    referenceColumn="entity_id" onDelete="CASCADE"/>
        <constraint xsi:type="foreign" referenceId="WISHLIST_PRODUCT_ALERT_PRICE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
                    table="wishlist_product_alert_price" column="website_id" referenceTable="store_website"
                    referenceColumn="website_id" onDelete="CASCADE"/>
        <constraint xsi:type="foreign" referenceId="WISHLIST_PRODUCT_ALERT_PRICE_WISHLIST_ID_WISHLIST_WISHLIST_ID"
                    table="wishlist_product_alert_price" column="wishlist_id" referenceTable="wishlist"
                    referenceColumn="wishlist_id" onDelete="CASCADE"/>
        <index referenceId="WISHLIST_PRODUCT_ALERT_PRICE_CUSTOMER_ID" indexType="btree">
            <column name="customer_id"/>
        </index>
        <index referenceId="WISHLIST_PRODUCT_ALERT_PRICE_PRODUCT_ID" indexType="btree">
            <column name="product_id"/>
        </index>
        <index referenceId="WISHLIST_PRODUCT_ALERT_PRICE_WEBSITE_ID" indexType="btree">
            <column name="website_id"/>
        </index>
        <index referenceId="WISHLIST_PRODUCT_ALERT_PRICE_WISHLIST_ID" indexType="btree">
            <column name="wishlist_id"/>
        </index>
    </table>

</schema>
