src-db/database/model/tables/M_PRODUCT.xml
author Rafa Roda Palacios <rafael.roda@openbravo.com>
Wed, 03 Feb 2010 23:00:50 +0100
changeset 6094 de65edc16ba8
parent 6084 d77e43abfbde
child 8504 802eae4a434d
permissions -rw-r--r--
Issue 11513 Added onCreateDefault to ATTRSETVALUETYPE column and modified M_PRODUCT_ATSETVALTYPE_CHK constraint and message.
<?xml version="1.0"?>
  <database name="TABLE M_PRODUCT">
    <table name="M_PRODUCT" primaryKey="M_PRODUCT_KEY">
      <column name="M_PRODUCT_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="VALUE" primaryKey="false" required="true" type="NVARCHAR" size="40" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="NAME" primaryKey="false" required="true" type="NVARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DOCUMENTNOTE" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="HELP" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPC" primaryKey="false" required="false" type="NVARCHAR" size="30" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="SKU" primaryKey="false" required="false" type="VARCHAR" size="30" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_UOM_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="SALESREP_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISSUMMARY" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISSTOCKED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISPURCHASED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISSOLD" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISBOM" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISINVOICEPRINTDETAILS" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISPICKLISTPRINTDETAILS" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISVERIFIED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="M_PRODUCT_CATEGORY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CLASSIFICATION" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="VOLUME" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="WEIGHT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="SHELFWIDTH" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="SHELFHEIGHT" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="SHELFDEPTH" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UNITSPERPALLET" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_TAXCATEGORY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="S_RESOURCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DISCONTINUED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="DISCONTINUEDBY" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PROCESSING" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="S_EXPENSETYPE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PRODUCTTYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[I]]></default>
        <onCreateDefault/>
      </column>
      <column name="IMAGEURL" primaryKey="false" required="false" type="NVARCHAR" size="120" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DESCRIPTIONURL" primaryKey="false" required="false" type="NVARCHAR" size="120" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="GUARANTEEDAYS" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="VERSIONNO" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="M_ATTRIBUTESET_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="M_ATTRIBUTESETINSTANCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DOWNLOADURL" primaryKey="false" required="false" type="NVARCHAR" size="120" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="M_FREIGHTCATEGORY_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="M_LOCATOR_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_IMAGE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISPRICEPRINTED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="NAME2" primaryKey="false" required="false" type="NVARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="COSTTYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="COSTSTD" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="STOCK_MIN" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ENFORCE_ATTRIBUTE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="CALCULATED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="MA_PROCESSPLAN_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PRODUCTION" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="CAPACITY" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DELAYMIN" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="MRP_PLANNER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="MRP_PLANNINGMETHOD_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="QTYMAX" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="QTYMIN" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="QTYSTD" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="QTYTYPE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="STOCKMIN" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ATTRSETVALUETYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault><![CDATA[CASE WHEN M_ATTRIBUTESETINSTANCE_ID IS NOT NULL THEN 'D' ELSE NULL END]]></onCreateDefault>
      </column>
      <foreign-key foreignTable="AD_ORG" name="AD_ORG_MPRODUCT">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCT_AD_CLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_IMAGE" name="M_PRODUCT_AD_IMAGE">
        <reference local="AD_IMAGE_ID" foreign="AD_IMAGE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="M_PRODUCT_AD_USER">
        <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER" name="M_PRODUCT_C_BPARTNER">
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_TAXCATEGORY" name="M_PRODUCT_C_TAXCATEGORY">
        <reference local="C_TAXCATEGORY_ID" foreign="C_TAXCATEGORY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_UOM" name="M_PRODUCT_C_UOM">
        <reference local="C_UOM_ID" foreign="C_UOM_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_ATTRIBUTESET" name="M_PRODUCT_M_ATTRIBUTESET" onDelete="cascade">
        <reference local="M_ATTRIBUTESET_ID" foreign="M_ATTRIBUTESET_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_ATTRIBUTESETINSTANCE" name="M_PRODUCT_M_ATTRIBUTESETINSTAN">
        <reference local="M_ATTRIBUTESETINSTANCE_ID" foreign="M_ATTRIBUTESETINSTANCE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_FREIGHTCATEGORY" name="M_PRODUCT_M_FREIGHTCATEGORY">
        <reference local="M_FREIGHTCATEGORY_ID" foreign="M_FREIGHTCATEGORY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_LOCATOR" name="M_PRODUCT_M_LOCATOR">
        <reference local="M_LOCATOR_ID" foreign="M_LOCATOR_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_PRODUCT_CATEGORY" name="M_PRODUCT_M_PRODUCT_CATEGORY">
        <reference local="M_PRODUCT_CATEGORY_ID" foreign="M_PRODUCT_CATEGORY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="MRP_PLANNER" name="M_PRODUCT_MRP_PLANNER">
        <reference local="MRP_PLANNER_ID" foreign="MRP_PLANNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="MRP_PLANNINGMETHOD" name="M_PRODUCT_MRP_PLANNINGMETHOD">
        <reference local="MRP_PLANNINGMETHOD_ID" foreign="MRP_PLANNINGMETHOD_ID"/>
      </foreign-key>
      <foreign-key foreignTable="S_EXPENSETYPE" name="M_PRODUCT_S_EXPENSETYPE">
        <reference local="S_EXPENSETYPE_ID" foreign="S_EXPENSETYPE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="S_RESOURCE" name="M_PRODUCT_S_RESOURCE">
        <reference local="S_RESOURCE_ID" foreign="S_RESOURCE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="MA_PROCESSPLAN" name="MA_PROCESSPLAN_MPRODUCT">
        <reference local="MA_PROCESSPLAN_ID" foreign="MA_PROCESSPLAN_ID"/>
      </foreign-key>
      <index name="M_PRODUCT_BPARTNER" unique="false">
        <index-column name="C_BPARTNER_ID"/>
      </index>
      <index name="M_PRODUCT_NAME" unique="false">
        <index-column name="NAME"/>
      </index>
      <index name="M_PRODUCT_PRODUCTCATEGORY" unique="false">
        <index-column name="M_PRODUCT_CATEGORY_ID"/>
      </index>
      <index name="M_PRODUCT_UPC" unique="false">
        <index-column name="UPC"/>
      </index>
      <unique name="M_PRODUCT_EXPENSETYPE">
        <unique-column name="S_EXPENSETYPE_ID"/>
      </unique>
      <unique name="M_PRODUCT_RESOURCE">
        <unique-column name="S_RESOURCE_ID"/>
      </unique>
      <unique name="M_PRODUCT_VALUE">
        <unique-column name="AD_CLIENT_ID"/>
        <unique-column name="VALUE"/>
      </unique>
      <check name="M_PRODUCT_ATSETVALTYPE_CHK"><![CDATA[(M_ATTRIBUTESETINSTANCE_ID IS NULL) OR (ATTRSETVALUETYPE IS NOT NULL)]]></check>
      <check name="M_PRODUCT_DISCONTINUED_CHECK"><![CDATA[DISCONTINUED IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ENFORCE_ATTRIBUT_CHK"><![CDATA[ENFORCE_ATTRIBUTE IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISBOM_CHECK"><![CDATA[ISBOM IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISINVOICEPRINTDE_CHK"><![CDATA[ISINVOICEPRINTDETAILS IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISPICKLISTPRINTD_CHK"><![CDATA[ISPICKLISTPRINTDETAILS IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISPURCHASED_CHECK"><![CDATA[ISPURCHASED IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISSOLD_CHECK"><![CDATA[ISSOLD IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISSTOCKED_CHECK"><![CDATA[ISSTOCKED IN ('Y', 'N')]]></check>
      <check name="M_PRODUCT_ISVERIFIED_CHECK"><![CDATA[ISVERIFIED IN ('Y', 'N')]]></check>
    </table>
  </database>