<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Store Locator Indexer for Magento 2 (System)
 */-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="amasty_amlocator_location_index" resource="default" engine="innodb" comment="Amasty Index Locations Table">
        <column xsi:type="int" name="location_id" padding="11" unsigned="false" nullable="false" identity="false" comment="Location Id"/>
        <column xsi:type="int" name="product_id" padding="11" unsigned="false" nullable="false" identity="false" comment="Product ID"/>
        <column xsi:type="int" name="store_id" padding="11" unsigned="false" nullable="false" identity="false" comment="Store ID"/>
        <index referenceId="AMASTY_AMLOCATOR_LOCATION_IDX_LOCATION_ID_PRD_ID_STORE_ID" indexType="btree">
            <column name="location_id"/>
            <column name="product_id"/>
            <column name="store_id"/>
        </index>
    </table>

    <table name="amasty_amlocator_content_location_index" resource="default" engine="innodb" comment="Amasty Index Locations Content Table">
        <column xsi:type="int" name="record_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Record ID"/>
        <column xsi:type="int" name="location_id" padding="11" unsigned="false" nullable="false" identity="false" comment="Location Id"/>
        <column xsi:type="text" name="store_list_html" nullable="true" comment="Store List Html"/>
        <column xsi:type="text" name="popup_html" nullable="true" comment="Popup Html"/>
        <column xsi:type="int" name="store_id" nullable="false" comment="Store ID"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="record_id"/>
        </constraint>
        <index referenceId="AMASTY_AMLOCATOR_LOCATION_INDEX_LOCATION_ID" indexType="btree">
            <column name="location_id"/>
        </index>
        <index referenceId="AMASTY_AMLOCATOR_LOCATION_INDEX_STORE_ID" indexType="btree">
            <column name="store_id"/>
        </index>
    </table>
</schema>
