<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : almacenes.xml
    Author     : Carlos Garcia Gomez
    Description:
        Structure for the almacenes table.
-->
<table>
    <column>
        <name>activo</name>
        <type>boolean</type>
        <default>true</default>
    </column>
    <column>
        <name>apartado</name>
        <type>character varying(10)</type>
    </column>
    <column>
        <name>ciudad</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>codalmacen</name>
        <type>character varying(4)</type>
        <null>NO</null>
    </column>
    <column>
        <name>codpais</name>
        <type>character varying(20)</type>
    </column>
    <column>
        <name>codpostal</name>
        <type>character varying(10)</type>
    </column>
    <column>
        <name>direccion</name>
        <type>character varying(200)</type>
    </column>
    <column>
        <name>idempresa</name>
        <type>integer</type>
    </column>
    <column>
        <name>nombre</name>
        <type>character varying(100)</type>
        <null>NO</null>
    </column>
    <column>
        <name>provincia</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>telefono</name>
        <type>character varying(30)</type>
    </column>
    <constraint>
        <name>almacenes_pkey</name>
        <type>PRIMARY KEY (codalmacen)</type>
    </constraint>
    <constraint>
        <name>ca_almacenes_empresas</name>
        <type>FOREIGN KEY (idempresa) REFERENCES empresas (idempresa) ON DELETE CASCADE ON UPDATE CASCADE</type>
    </constraint>
</table>
