src-db/database/model/tables/AD_TABLE.xml
author Augusto Mauch <augusto.mauch@openbravo.com>
Wed, 05 Jun 2013 14:03:22 +0200
changeset 20511 e426b7ccc826
parent 20510 f7a3e45cbddf
child 20512 02b4db5308b3
permissions -rw-r--r--
Fixes issue 23996: An event handler has been replaced with database constraints

The event handler TableDataOriginEventHandler has been replaced with database constraints. This is a better approach because it is simpler and easier to maint
ain.

The name of two of the messages has been updated so that it is the name as the constraint that throw them. The message used to warn the user that the table_name must be set if the data origin is 'Table' has been removed because now the table_name is mandatory again in the database.
carlos@0
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="TABLE AD_TABLE">
carlos@0
     3
    <table name="AD_TABLE" primaryKey="AD_TABLE_KEY">
juanpablo@1605
     4
      <column name="AD_TABLE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
     5
        <default/>
antonio@735
     6
        <onCreateDefault/>
antonio@735
     7
      </column>
juanpablo@1605
     8
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
     9
        <default/>
antonio@735
    10
        <onCreateDefault/>
antonio@735
    11
      </column>
juanpablo@1605
    12
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    13
        <default/>
antonio@735
    14
        <onCreateDefault/>
antonio@735
    15
      </column>
antonio@735
    16
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    17
        <default><![CDATA[Y]]></default>
antonio@735
    18
        <onCreateDefault/>
antonio@735
    19
      </column>
antonio@735
    20
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    21
        <default><![CDATA[SYSDATE]]></default>
antonio@735
    22
        <onCreateDefault/>
antonio@735
    23
      </column>
juanpablo@1605
    24
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    25
        <default/>
antonio@735
    26
        <onCreateDefault/>
antonio@735
    27
      </column>
antonio@735
    28
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    29
        <default><![CDATA[SYSDATE]]></default>
antonio@735
    30
        <onCreateDefault/>
antonio@735
    31
      </column>
juanpablo@1605
    32
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    33
        <default/>
antonio@735
    34
        <onCreateDefault/>
antonio@735
    35
      </column>
antonio@735
    36
      <column name="NAME" primaryKey="false" required="true" type="NVARCHAR" size="60" autoIncrement="false">
antonio@735
    37
        <default/>
antonio@735
    38
        <onCreateDefault/>
antonio@735
    39
      </column>
antonio@735
    40
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
antonio@735
    41
        <default/>
antonio@735
    42
        <onCreateDefault/>
antonio@735
    43
      </column>
antonio@735
    44
      <column name="HELP" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
antonio@735
    45
        <default/>
antonio@735
    46
        <onCreateDefault/>
antonio@735
    47
      </column>
augusto@20510
    48
      <column name="TABLENAME" primaryKey="false" required="true" type="VARCHAR" size="40" autoIncrement="false">
antonio@735
    49
        <default/>
antonio@735
    50
        <onCreateDefault/>
antonio@735
    51
      </column>
augusto@20373
    52
      <column name="CLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
asier@1929
    53
        <default/>
antonio@2766
    54
        <onCreateDefault><![CDATA[REPLACE(NAME,'_','')]]></onCreateDefault>
asier@1929
    55
      </column>
antonio@735
    56
      <column name="ISVIEW" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    57
        <default><![CDATA[N]]></default>
antonio@735
    58
        <onCreateDefault/>
antonio@735
    59
      </column>
asier@2586
    60
      <column name="ACCESSLEVEL" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
antonio@735
    61
        <default/>
antonio@735
    62
        <onCreateDefault/>
antonio@735
    63
      </column>
juanpablo@1605
    64
      <column name="AD_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    65
        <default/>
antonio@735
    66
        <onCreateDefault/>
antonio@735
    67
      </column>
antonio@735
    68
      <column name="ISSECURITYENABLED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
antonio@735
    69
        <default><![CDATA[N]]></default>
antonio@735
    70
        <onCreateDefault/>
antonio@735
    71
      </column>
antonio@735
    72
      <column name="ISDELETEABLE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    73
        <default><![CDATA[Y]]></default>
antonio@735
    74
        <onCreateDefault/>
antonio@735
    75
      </column>
antonio@735
    76
      <column name="ISHIGHVOLUME" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    77
        <default><![CDATA[N]]></default>
antonio@735
    78
        <onCreateDefault/>
antonio@735
    79
      </column>
antonio@735
    80
      <column name="IMPORTTABLE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
antonio@735
    81
        <default/>
antonio@735
    82
        <onCreateDefault/>
antonio@735
    83
      </column>
antonio@735
    84
      <column name="ISCHANGELOG" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
antonio@735
    85
        <default><![CDATA[N]]></default>
antonio@735
    86
        <onCreateDefault/>
antonio@735
    87
      </column>
juanpablo@1605
    88
      <column name="PO_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    89
        <default/>
antonio@735
    90
        <onCreateDefault/>
antonio@735
    91
      </column>
antonio@735
    92
      <column name="ISDEFAULTACCT" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
antonio@735
    93
        <default><![CDATA[N]]></default>
antonio@735
    94
        <onCreateDefault/>
antonio@735
    95
      </column>
antonio@735
    96
      <column name="SQL_RECORD_IDENTIFIER" primaryKey="false" required="false" type="VARCHAR" size="4000" autoIncrement="false">
antonio@735
    97
        <default/>
antonio@735
    98
        <onCreateDefault/>
antonio@735
    99
      </column>
asier@2586
   100
      <column name="DEVELOPMENTSTATUS" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
antonio@735
   101
        <default><![CDATA[RE]]></default>
antonio@735
   102
        <onCreateDefault/>
antonio@735
   103
      </column>
antonio@2445
   104
      <column name="AD_PACKAGE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
asier@1644
   105
        <default><![CDATA[0]]></default>
antonio@2371
   106
        <onCreateDefault><![CDATA[SELECT AD_PACKAGE_ID FROM AD_PACKAGE WHERE AD_MODULE_ID<>'0']]></onCreateDefault>
asier@1644
   107
      </column>
martin@3757
   108
      <column name="TREETYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
martin@3757
   109
        <default/>
martin@3757
   110
        <onCreateDefault/>
martin@3757
   111
      </column>
gorkaion@4844
   112
      <column name="ACCTDATE_COLUMN_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
gorkaion@4844
   113
        <default/>
gorkaion@4844
   114
        <onCreateDefault/>
gorkaion@4844
   115
      </column>
gorkaion@4844
   116
      <column name="ACCTCLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="1000" autoIncrement="false">
gorkaion@4844
   117
        <default/>
gorkaion@4844
   118
        <onCreateDefault/>
gorkaion@4844
   119
      </column>
asier@6263
   120
      <column name="ISFULLYAUDITED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
asier@6263
   121
        <default><![CDATA[N]]></default>
asier@6263
   122
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
asier@6263
   123
      </column>
augusto@20177
   124
      <column name="ISAUDITINSERTS" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
augusto@20177
   125
        <default><![CDATA[Y]]></default>
augusto@20177
   126
        <onCreateDefault><![CDATA['Y']]></onCreateDefault>
augusto@20177
   127
      </column>
augusto@20373
   128
      <column name="DATAORIGINTYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
augusto@20373
   129
        <default><![CDATA[Table]]></default>
augusto@20373
   130
        <onCreateDefault><![CDATA['Table']]></onCreateDefault>
augusto@20373
   131
      </column>
augusto@20373
   132
      <column name="OBSERDS_DATASOURCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
augusto@20373
   133
        <default/>
augusto@20373
   134
        <onCreateDefault/>
augusto@20373
   135
      </column>
augusto@20373
   136
      <foreign-key foreignTable="OBSERDS_DATASOURCE" name="AD_COLUMN_DATASOURCE">
augusto@20373
   137
        <reference local="OBSERDS_DATASOURCE_ID" foreign="OBSERDS_DATASOURCE_ID"/>
augusto@20373
   138
      </foreign-key>
gorkaion@4844
   139
      <foreign-key foreignTable="AD_COLUMN" name="AD_COLUMN_TABLE">
gorkaion@4844
   140
        <reference local="ACCTDATE_COLUMN_ID" foreign="AD_COLUMN_ID"/>
gorkaion@4844
   141
      </foreign-key>
asier@1929
   142
      <foreign-key foreignTable="AD_PACKAGE" name="AD_PACKAGE_TABLE">
asier@1929
   143
        <reference local="AD_PACKAGE_ID" foreign="AD_PACKAGE_ID"/>
asier@1929
   144
      </foreign-key>
asier@5551
   145
      <foreign-key foreignTable="AD_CLIENT" name="AD_TABLE_AD_CLIENT">
asier@5551
   146
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
asier@5551
   147
      </foreign-key>
asier@5551
   148
      <foreign-key foreignTable="AD_ORG" name="AD_TABLE_AD_ORG">
asier@5551
   149
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
asier@5551
   150
      </foreign-key>
martin@2771
   151
      <foreign-key foreignTable="AD_WINDOW" name="AD_TABLE_AD_WINDOW">
martin@2771
   152
        <reference local="PO_WINDOW_ID" foreign="AD_WINDOW_ID"/>
martin@2771
   153
      </foreign-key>
adrian@170
   154
      <foreign-key foreignTable="AD_WINDOW" name="AD_WINDOW_TABLE" onDelete="setnull">
adrian@170
   155
        <reference local="AD_WINDOW_ID" foreign="AD_WINDOW_ID"/>
adrian@170
   156
      </foreign-key>
asier@5555
   157
      <index name="AD_TABLE_PACKAGE_IDX" unique="false">
asier@1929
   158
        <index-column name="AD_PACKAGE_ID"/>
asier@1929
   159
      </index>
asier@5551
   160
      <unique name="AD_TABLE_CLASSNAME_PACKAGE_UN">
asier@5551
   161
        <unique-column name="CLASSNAME"/>
asier@5551
   162
        <unique-column name="AD_PACKAGE_ID"/>
asier@5551
   163
      </unique>
carlos@0
   164
      <unique name="AD_TABLE_NAME">
carlos@0
   165
        <unique-column name="NAME"/>
carlos@0
   166
      </unique>
asier@5551
   167
      <unique name="AD_TABLE_TREETYPE_UN">
martin@3757
   168
        <unique-column name="TREETYPE"/>
martin@3757
   169
      </unique>
augusto@20511
   170
      <check name="AD_TABLE_CLASSNAME_CHK"><![CDATA[((DATAORIGINTYPE) = 'DATASOURCE') OR (CLASSNAME IS NOT NULL)]]></check>
augusto@20511
   171
      <check name="AD_TABLE_DATASOURCE_CHK"><![CDATA[((DATAORIGINTYPE) = 'TABLE') OR (OBSERDS_DATASOURCE_ID IS NOT NULL)]]></check>
stefan@8509
   172
      <check name="AD_TABLE_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
augusto@20177
   173
      <check name="AD_TABLE_ISAUDITINS_CHK"><![CDATA[ISAUDITINSERTS IN ('Y', 'N')]]></check>
stefan@8509
   174
      <check name="AD_TABLE_ISDELETEABLE_CHK"><![CDATA[ISDELETEABLE IN ('Y', 'N')]]></check>
stefan@8509
   175
      <check name="AD_TABLE_ISFULLYAUDITED_CHK"><![CDATA[ISFULLYAUDITED IN ('Y', 'N')]]></check>
stefan@8509
   176
      <check name="AD_TABLE_ISFULLYAUDITED_CHK2"><![CDATA[(ISFULLYAUDITED = 'N') OR (UPPER((TABLENAME)) <> 'AD_AUDIT_TRAIL')]]></check>
stefan@8509
   177
      <check name="AD_TABLE_ISHIGHVOLUME_CHK"><![CDATA[ISHIGHVOLUME IN ('Y', 'N')]]></check>
stefan@8509
   178
      <check name="AD_TABLE_ISSECUR_YENABLED_CHK"><![CDATA[ISSECURITYENABLED IN ('Y', 'N')]]></check>
stefan@8509
   179
      <check name="AD_TABLE_ISVIEW_CHK"><![CDATA[ISVIEW IN ('Y', 'N')]]></check>
carlos@0
   180
    </table>
adrian@94
   181
  </database>