<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : formatos_documentos.xml
    Author     : Cristo M. Estévez Hernández
    Description:
        Structure for the formatos_documentos table.
-->
<table>
    <column>
        <name>autoaplicar</name>
        <type>boolean</type>
        <default>true</default>
    </column>
    <column>
        <name>codserie</name>
        <type>character varying(4)</type>
    </column>
    <column>
        <name>id</name>
        <type>serial</type>
        <null>NO</null>
    </column>
    <column>
        <name>idempresa</name>
        <type>integer</type>
    </column>
    <column>
        <name>idlogo</name>
        <type>integer</type>
    </column>
    <column>
        <name>nombre</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>texto</name>
        <type>text</type>
    </column>
    <column>
        <name>tipodoc</name>
        <type>character varying(30)</type>
    </column>
    <column>
        <name>titulo</name>
        <type>character varying(30)</type>
    </column>
    <constraint>
        <name>formatos_documentos_pkey</name>
        <type>PRIMARY KEY (id)</type>
    </constraint>
    <constraint>
        <name>ca_formatos_documentos_series</name>
        <type>FOREIGN KEY (codserie) REFERENCES series (codserie) ON DELETE CASCADE ON UPDATE CASCADE</type>
    </constraint>
    <constraint>
        <name>ca_formatos_documentos_empresas</name>
        <type>FOREIGN KEY (idempresa) REFERENCES empresas (idempresa) ON DELETE CASCADE ON UPDATE CASCADE</type>
    </constraint>
    <constraint>
        <name>ca_formatos_documentos_attached_files</name>
        <type>FOREIGN KEY (idlogo) REFERENCES attached_files (idfile) ON DELETE SET NULL ON UPDATE CASCADE</type>
    </constraint>
</table>