<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Two-Factor Authentication 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_securityauth_admin_user" resource="default" engine="innodb" comment="Amasty Security Auth Table">
    <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Id"/>
    <column xsi:type="int" name="user_id" padding="10" unsigned="true" nullable="false" identity="false" comment="User Id"/>
    <column xsi:type="boolean" name="enable" nullable="false" comment="Enable two step verification"/>
    <column xsi:type="text" name="two_factor_token" nullable="true" comment="Token for two step verification"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="id"/>
    </constraint>
    <constraint xsi:type="foreign" referenceId="AMASTY_SECURITYAUTH_ADMIN_USER_USER_ID_ADMIN_USER_USER_ID" table="amasty_securityauth_admin_user" column="user_id" referenceTable="admin_user" referenceColumn="user_id" onDelete="CASCADE"/>
    <index referenceId="AMASTY_SECURITYAUTH_ADMIN_USER_USER_ID" indexType="btree">
      <column name="user_id"/>
    </index>
  </table>
</schema>
