<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : emails_sent.xml
    Author     : Carlos Garcia Gomez
    Description:
        Structure for the emails_sent table.
-->
<table>
    <column>
        <name>addressee</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>attachment</name>
        <type>bool</type>
        <default>false</default>
    </column>
    <column>
        <name>body</name>
        <type>text</type>
    </column>
    <column>
        <name>date</name>
        <type>timestamp</type>
    </column>
    <column>
        <name>email_from</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>html</name>
        <type>text</type>
    </column>
    <column>
        <name>id</name>
        <type>serial</type>
        <null>NO</null>
    </column>
    <column>
        <name>nick</name>
        <type>character varying(50)</type>
    </column>
    <column>
        <name>opened</name>
        <type>boolean</type>
        <default>false</default>
    </column>
    <column>
        <name>subject</name>
        <type>character varying(300)</type>
    </column>
    <column>
        <name>uuid</name>
        <type>character varying(13)</type>
    </column>
    <column>
        <name>verificode</name>
        <type>character varying(20)</type>
    </column>
    <constraint>
        <name>emails_sent_pkey</name>
        <type>PRIMARY KEY (id)</type>
    </constraint>
    <constraint>
        <name>emails_sent_user</name>
        <type>FOREIGN KEY (nick) REFERENCES users (nick) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
</table>