<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
    <name>*dbname*</name>
    <create>true</create>
    <overwrite>false</overwrite>
    <charset>utf8</charset>
    <table>
        <name>*dbprefix*twofactor_totp_secrets</name>
        <declaration>
            <field>
                <name>id</name>
                <type>integer</type>
                <autoincrement>1</autoincrement>
                <default>0</default>
                <notnull>true</notnull>
                <length>4</length>
            </field>
            <field>
                <name>user_id</name>
                <type>text</type>
                <default></default>
                <notnull>true</notnull>
                <length>64</length>
            </field>
            <field>
                <name>secret</name>
                <type>clob</type>
                <notnull>true</notnull>
            </field>
	    <!--
		STATE 0 : disabled
		STATE 1 : created (but not active)
		STATE 2 : enabled
	    -->
	    <field>
                <name>state</name>
                <type>integer</type>
		<default>2</default>
                <notnull>true</notnull>
            </field>

            <index>
                <name>totp_secrets_user_id</name>
                <unique>true</unique>
                <field>
                    <name>user_id</name>
                    <sorting>ascending</sorting>
                </field>
            </index>
        </declaration>
    </table>
</database>
