<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : api_keys.xml
    Author     : Joe Nilson Zegarra Galvez
    Description:
        Structure for the api_keys table.
-->
<table>
    <column>
        <name>apikey</name>
        <type>character varying(99)</type>
        <null>NO</null>
    </column>
    <column>
        <name>creationdate</name>
        <type>date</type>
        <null>NO</null>
    </column>
    <column>
        <name>description</name>
        <type>character varying(150)</type>
        <null>NO</null>
    </column>
    <column>
        <name>enabled</name>
        <type>boolean</type>
        <null>NO</null>
    </column>
    <column>
        <name>fullaccess</name>
        <type>boolean</type>
        <default>false</default>
    </column>
    <column>
        <name>lastactivity</name>
        <type>timestamp</type>
    </column>
    <column>
        <name>id</name>
        <type>serial</type>
        <null>NO</null>
    </column>
    <column>
        <name>nick</name>
        <type>character varying(50)</type>
    </column>
    <constraint>
        <name>api_keys_pkey</name>
        <type>PRIMARY KEY (id)</type>
    </constraint>
    <constraint>
        <name>ca_api_keys_nick</name>
        <type>FOREIGN KEY (nick) REFERENCES users (nick) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
</table>