<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Facebook Pixel Pro for Magento 2
 */-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="amasty_fbpixel_pixel_server_side_settings" resource="default" engine="innodb" comment="">
        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"/>
        <column xsi:type="boolean" name="is_active" nullable="false" default="0" />
        <column xsi:type="varchar" name="token" nullable="true" length="255"/>
        <column xsi:type="varchar" name="test_event_code" nullable="true" length="50"/>
        <column xsi:type="int" name="pixel_entity_id" padding="10" unsigned="true" nullable="false" identity="false"/>
        <column xsi:type="boolean" name="is_category_view_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_product_view_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_initiate_checkout_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_purchase_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_search_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_add_to_cart_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_add_to_wishlist_enabled" nullable="false" default="0"/>
        <column xsi:type="boolean" name="is_registration_enabled" nullable="false" default="0"/>
        <constraint xsi:type="foreign"
                    referenceId="AMASTY_FBPIXEL_PIXEL_SERVER_SIDE_SETTINGS_PIXEL_ID_PIXEL_ENTITY_ID"
                    table="amasty_fbpixel_pixel_server_side_settings" column="pixel_entity_id" referenceTable="amasty_fbpixel_pixels"
                    referenceColumn="entity_id" onDelete="CASCADE"/>
        <constraint xsi:type="unique" referenceId="AMASTY_FBPIXEL_SERVER_SIDE_SETTINGS_PIXEL_ID_UNIQUE">
            <column name="pixel_entity_id"/>
        </constraint>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
    </table>
    <table name="amasty_fbpixel_pixel_server_side_queue" resource="default" engine="innodb" comment="">
        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"/>
        <column xsi:type="varchar" name="token" nullable="false" length="255" />
        <column xsi:type="varchar" name="pixel_id" nullable="false" length="255" />
        <column xsi:type="varchar" name="test_event_code" nullable="true" length="50"/>
        <column xsi:type="text" name="event_data" nullable="false" />
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
    </table>
</schema>
