<?xml version="1.0"?>
<!--
/**
 * Copyright © Klarna Bank AB (publ)
 *
 * For the full copyright and license information, please view the NOTICE
 * and LICENSE files that were distributed with this source code.
 */
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="klarna_installation" resource="default" engine="innodb" comment="Klarna Installation">
        <column name="id" xsi:type="int" padding="10" unsigned="true" nullable="false" identity="true"
                comment="Id"/>
        <column xsi:type="text" name="klarna_installation_id" nullable="false" comment="Klarna Installation Id"/>
        <column xsi:type="text" name="available_markets" nullable="false" comment="Markets that these features are available for this plugin installation"/>
        <column xsi:type="text" name="features" nullable="false" comment="Features available for this plugin installation"/>
        <column name="request_data" xsi:type="text" nullable="true" comment="Latest data for the request"/>
        <column xsi:type="varchar" length="3" default="" name="market" nullable="false" comment="Used market"/>
        <column xsi:type="varchar" length="8" default="default" name="scope" nullable="false" comment="Store scope"/>
        <column xsi:type="smallint" unsigned="true" default="0" name="store_id" nullable="false" comment="Store ID"/>
        <column name="created_at" xsi:type="timestamp" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
        <column name="updated_at" xsi:type="timestamp" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Updated At"/>

        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="id"/>
        </constraint>
    </table>
</schema>
