Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0008095
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajoralways2009-03-12 15:492009-04-29 00:00
ReporterrafarodaView Statuspublic 
Assigned Tomarvintm 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision258
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.5
OS VersionUbuntu 7.10Database version8.3Ant version1.7
Product Version2.40SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0008095: DBSourceManager: Constraint enabling should be done after onCreateDefault

DescriptionDBSourceManager should enable new constraints after executing onCreateDefault and not before.
Steps To Reproduce1) Create a new column in a XML table file with an onCreateDefault. For instance, in M_INOUT add:
<column name="FREIGHT_CURRENCY_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
        <default/>
        <onCreateDefault><![CDATA[SELECT C_ACCTSCHEMA.C_CURRENCY_ID FROM C_ACCTSCHEMA, AD_CLIENTINFO, AD_CLIENT WHERE AD_CLIENTINFO.C_ACCTSCHEMA1_ID = C_ACCTSCHEMA.C_ACCTSCHEMA_ID AND AD_CLIENT.AD_CLIENT_ID = AD_CLIENTINFO.AD_CLIENT_ID AND AD_CLIENT.AD_CLIENT_ID = M_INOUT.AD_CLIENT_ID]]></onCreateDefault>
      </column>
 <foreign-key foreignTable="C_CURRENCY" name="CCURRENCY_MINOUT">
        <reference local="FREIGHT_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
      </foreign-key>

2) Create a new check constraint in this same XML table.
<check name="M_INOUT_CURRENCY_CHECK"><![CDATA[(FREIGHTAMT IS NULL) OR (FREIGHT_CURRENCY_ID IS NOT NULL)]]></check>

3) Execute: ant update.database.structure
[alterdatabase] SQL Command failed with: ERROR: check constraint "m_inout_currency_check" is violated by some row
[alterdatabase] ALTER TABLE M_INOUT
[alterdatabase] ADD CONSTRAINT M_INOUT_CURRENCY_CHECK CHECK ((FREIGHTAMT IS NULL) OR (FREIGHT_CURRENCY_ID IS NOT NULL))
Proposed SolutionDBSourceManager should enable new constraints after executing onCreateDefault.
Tagsmain
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0008096 closedmarvintm DBSourceManager: Constraint enabling should be done after onCreateDefault 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2009-03-12 15:49 rafaroda New Issue
2009-03-12 15:49 rafaroda Assigned To => marvintm
2009-03-12 15:49 rafaroda Regression testing => No
2009-03-12 15:50 rafaroda Priority immediate => high
2009-03-12 15:50 rafaroda Status new => scheduled
2009-03-12 15:50 rafaroda fix_in_branch => pi
2009-03-12 15:52 rafaroda fix_in_branch pi =>
2009-03-12 15:52 rafaroda Proposed Solution updated
2009-03-12 17:32 marvintm Status scheduled => resolved
2009-03-12 17:32 marvintm Fixed in SCM revision => 258
2009-03-12 17:32 marvintm Resolution open => fixed
2009-04-22 11:24 psarobe Tag Attached: main
2009-04-28 20:06 psarobe Status resolved => closed
2009-04-29 00:00 anonymous sf_bug_id 0 => 2783249


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker