src-db/database/model/tables/C_CONVERSION_RATE.xml
author Álvaro Ferraz <alvaro.ferraz@openbravo.com>
Mon, 18 Nov 2019 12:47:40 +0100
changeset 36814 5a1554f3b7a1
parent 30750 6def5f7a644f
permissions -rw-r--r--
Related to issue 42295: Avoid API change in CancelAndReplaceUtils
<?xml version="1.0"?>
  <database name="TABLE C_CONVERSION_RATE">
    <table name="C_CONVERSION_RATE" primaryKey="C_CURRENCYRATE_KEY">
      <column name="C_CONVERSION_RATE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_CURRENCY_ID_TO" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="VALIDFROM" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="VALIDTO" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CONVERSIONRATETYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="MULTIPLYRATE" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="DIVIDERATE" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="C_CURRENCY" name="C_CONVERSION_RATE_C_CURRENCY">
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_CLIENT" name="C_CONVERSION_RATECLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="C_CONVERSION_RATEORG">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CURRENCY" name="C_CURRENCYCONVRATETO">
        <reference local="C_CURRENCY_ID_TO" foreign="C_CURRENCY_ID"/>
      </foreign-key>
      <unique name="C_CONVERSIONRATE_ONCE">
        <unique-column name="C_CURRENCY_ID"/>
        <unique-column name="C_CURRENCY_ID_TO"/>
        <unique-column name="AD_CLIENT_ID"/>
        <unique-column name="AD_ORG_ID"/>
        <unique-column name="CONVERSIONRATETYPE"/>
        <unique-column name="VALIDFROM"/>
      </unique>
      <check name="C_CONVERSION_RA_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="C_CONVERSION_RATE_RATE_CHECK"><![CDATA[MULTIPLYRATE > 0 AND DIVIDERATE > 0]]></check>
    </table>
  </database>