<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : roles_access.xml
    Author     : Carlos Garcia Gomez
    Description:
        Structure for the roles_access table.
-->
<table>
    <column>
        <name>allowdelete</name>
        <type>boolean</type>
        <null>NO</null>
        <default>true</default>
    </column>
    <column>
        <name>allowexport</name>
        <type>boolean</type>
        <null>NO</null>
        <default>true</default>
    </column>
    <column>
        <name>allowimport</name>
        <type>boolean</type>
        <null>NO</null>
        <default>true</default>
    </column>
    <column>
        <name>allowupdate</name>
        <type>boolean</type>
        <null>NO</null>
        <default>true</default>
    </column>
    <column>
        <name>codrole</name>
        <type>character varying(20)</type>
        <null>NO</null>
    </column>
    <column>
        <name>id</name>
        <type>serial</type>
        <null>NO</null>
    </column>
    <column>
        <name>onlyownerdata</name>
        <type>boolean</type>
        <null>NO</null>
        <default>false</default>
    </column>
    <column>
        <name>pagename</name>
        <type>character varying(40)</type>
        <null>NO</null>
    </column>
    <constraint>
        <name>roles_access_pkey</name>
        <type>PRIMARY KEY (id)</type>
    </constraint>
    <constraint>
        <name>ca_roles_access_roles</name>
        <type>FOREIGN KEY (codrole) REFERENCES roles (codrole) ON DELETE CASCADE ON UPDATE CASCADE</type>
    </constraint>
    <constraint>
        <name>unique_roles_access</name>
        <type>UNIQUE (codrole,pagename)</type>
    </constraint>
</table>