<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : paises.xml
    Author     : Carlos Garcia Gomez
    Description:
        Structure for the paises table.
-->
<table>
    <column>
        <name>alias</name>
        <type>text</type>
    </column>
    <column>
        <name>codiso</name>
        <type>character varying(2)</type>
    </column>
    <column>
        <name>codpais</name>
        <type>character varying(20)</type>
        <null>NO</null>
    </column>
    <column>
        <name>creation_date</name>
        <type>timestamp</type>
    </column>
    <column>
        <name>last_nick</name>
        <type>character varying(50)</type>
    </column>
    <column>
        <name>last_update</name>
        <type>timestamp</type>
    </column>
    <column>
        <name>latitude</name>
        <type>double precision</type>
    </column>
    <column>
        <name>longitude</name>
        <type>double precision</type>
    </column>
    <column>
        <name>nick</name>
        <type>character varying(50)</type>
    </column>
    <column>
        <name>nombre</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>telephone_prefix</name>
        <type>character varying(10)</type>
    </column>
    <constraint>
        <name>paises_pkey</name>
        <type>PRIMARY KEY (codpais)</type>
    </constraint>
    <constraint>
        <name>uniq_codiso_paises</name>
        <type>UNIQUE (codiso)</type>
    </constraint>
    <constraint>
        <name>ca_paises_users_last_nick</name>
        <type>FOREIGN KEY (last_nick) REFERENCES users (nick) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
    <constraint>
        <name>ca_paises_users_nick</name>
        <type>FOREIGN KEY (nick) REFERENCES users (nick) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
</table>