<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : empresas.xml
    Author     : Carlos Garcia Gomez
    Description:
        Structure for the empresas table.
-->
<table>
    <column>
        <name>administrador</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>apartado</name>
        <type>character varying(10)</type>
    </column>
    <column>
        <name>cifnif</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>ciudad</name>
        <type>character varying(100)</type>
    </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>email</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>fax</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>fechaalta</name>
        <type>date</type>
    </column>
    <column>
        <name>idempresa</name>
        <type>serial</type>
        <null>NO</null>
    </column>
    <column>
        <name>idlogo</name>
        <type>integer</type>
    </column>
    <column>
        <name>nombre</name>
        <type>character varying(100)</type>
        <null>NO</null>
    </column>
    <column>
        <name>nombrecorto</name>
        <type>character varying(32)</type>
    </column>
    <column>
        <name>observaciones</name>
        <type>text</type>
    </column>
    <column>
        <name>personafisica</name>
        <type>boolean</type>
        <default>false</default>
    </column>
    <column>
        <name>provincia</name>
        <type>character varying(100)</type>
    </column>
    <column>
        <name>regimeniva</name>
        <type>character varying(50)</type>
    </column>
    <column>
        <name>telefono1</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>telefono2</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>tipoidfiscal</name>
        <type>character varying(25)</type>
    </column>
    <column>
        <name>web</name>
        <type>character varying(100)</type>
    </column>
    <constraint>
        <name>empresas_pkey</name>
        <type>PRIMARY KEY (idempresa)</type>
    </constraint>
    <constraint>
        <name>ca_empresas_attached_files</name>
        <type>FOREIGN KEY (idlogo) REFERENCES attached_files (idfile) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
</table>