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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0029927
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2015-05-19 10:162015-06-04 09:42
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version3.0PR15Q3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression levelAutomated tests
Regression date2015-04-28
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
Triggers an Emergency PackNo
Summary

0029927: export database after upgrade from 2.50 results in formal changes

DescriptionWhen database is exported in an instance upgraded from 2.50, some formal (column position order in xml files) appear in sourcedata and model xml files.

These changes are introduced by the project to prevent table recreation [1]. Now new columns added to existing tables are always placed in the last physical position.

The differences seen in this case are:

hg st -m
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/model/tables/AD_FIELD.xml
M src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
M src-db/database/sourcedata/AD_FIELD.xml

There are changes in model for 2 tables (AD_Field and C_Acct_Default) [2] both of them caused by adding columns manually to xml files in the middle of old columns [3], which is not the common flow to create new columns (which is adding them in DB and exporting to xml afterwards).

Modifications in sourcedata occur due to model changes in AD_Field table. They appear for all AD_Field tables and consist in placing Property and IgnoreInWad columns in a different place in the exported xml [4].

---

[1] http://wiki.openbravo.com/wiki/Projects:Table_Recreation_Prevention [^]

[2] Model changes after upgrading from 2.50 to pi:

hg diff src-db/database/model/tables/
diff -r b9ab1a7d0969 src-db/database/model/tables/AD_FIELD.xml
--- a/src-db/database/model/tables/AD_FIELD.xml Thu May 14 15:46:56 2015 +0000
+++ b/src-db/database/model/tables/AD_FIELD.xml Thu May 28 08:24:18 2015 +0200
@@ -57,14 +57,6 @@
         <default/>
         <onCreateDefault/>
       </column>
- <column name="PROPERTY" primaryKey="false" required="false" type="VARCHAR" size="255" autoIncrement="false">
- <default/>
- <onCreateDefault/>
- </column>
- <column name="IGNOREINWAD" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
- <default><![CDATA[N]]></default>
- <onCreateDefault><![CDATA['N']]></onCreateDefault>
- </column>
       <column name="AD_FIELDGROUP_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -121,6 +113,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="PROPERTY" primaryKey="false" required="false" type="VARCHAR" size="255" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
+ <column name="IGNOREINWAD" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+ <default><![CDATA[N]]></default>
+ <onCreateDefault><![CDATA['N']]></onCreateDefault>
+ </column>
       <column name="STARTINODDCOLUMN" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
diff -r b9ab1a7d0969 src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
--- a/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Thu May 14 15:46:56 2015 +0000
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Thu May 28 08:24:18 2015 +0200
@@ -109,10 +109,6 @@
         <default/>
         <onCreateDefault/>
       </column>
- <column name="WRITEOFF_REV_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
- <default/>
- <onCreateDefault/>
- </column>
       <column name="PAYDISCOUNT_REV_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -169,18 +165,10 @@
         <default/>
         <onCreateDefault/>
       </column>
- <column name="T_DUE_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
- <default/>
- <onCreateDefault/>
- </column>
       <column name="T_CREDIT_ACCT" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
       </column>
- <column name="T_CREDIT_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
- <default/>
- <onCreateDefault/>
- </column>
       <column name="B_INTRANSIT_ACCT" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -297,6 +285,18 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="WRITEOFF_REV_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
+ <column name="T_DUE_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
+ <column name="T_CREDIT_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <column name="P_REVENUE_RETURN_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>


[3] changesets adding columns in the middle of the table:

hg log -r 21513 src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml -p
changeset: 21513:d35376bf3445
user: Víctor Martínez Romanos <victor.martinez@openbravo.com>
date: Thu Nov 28 11:24:57 2013 +0100
summary: [cashvat] Fixed issue 24615: Cash VAT Management

diff -r 7b18cd543a03 -r d35376bf3445 src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
--- a/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Wed Dec 04 10:40:35 2013 +0100
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Thu Nov 28 11:24:57 2013 +0100
@@ -169,10 +169,18 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="T_DUE_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <column name="T_CREDIT_ACCT" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="T_CREDIT_TRANS_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <column name="B_INTRANSIT_ACCT" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>


hg log -r 13194 src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml -p
changeset: 13194:e622dead28b4
user: Eduardo Argal Guibert <eduardo.argal@openbravo.com>
date: Tue Jul 19 13:37:14 2011 +0200
summary: Fixes bug 0017774: Wrong accounting for write off amounts

diff -r ba65e8f92c8a -r e622dead28b4 src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
--- a/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Tue Jul 19 13:21:35 2011 +0200
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml Tue Jul 19 13:37:14 2011 +0200
@@ -109,6 +109,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="WRITEOFF_REV_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <column name="PAYDISCOUNT_REV_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -285,6 +289,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCHEMA_DEF_WRITEOFF_REV">
+ <reference local="WRITEOFF_REV_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+ </foreign-key>
       <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCHEMA_DEFAULT_A_ACCUMDE">
         <reference local="A_ACCUMDEPRECIATION_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
       </foreign-key>
hg log -r 16881 src-db/database/model/tables/AD_FIELD.xml -p
changeset: 16881:2452b393ee6e
user: Martin Taal <martin.taal@openbravo.com>
date: Wed Jun 13 05:52:49 2012 +0200
summary: Fixes issue 20732: Implement property/computed fields

diff -r 498e63e628f4 -r 2452b393ee6e src-db/database/model/tables/AD_FIELD.xml
--- a/src-db/database/model/tables/AD_FIELD.xml Wed Jun 20 18:26:56 2012 +0200
+++ b/src-db/database/model/tables/AD_FIELD.xml Wed Jun 13 05:52:49 2012 +0200
@@ -57,6 +57,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="PROPERTY" primaryKey="false" required="false" type="VARCHAR" size="255" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <column name="AD_FIELDGROUP_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>

[4] differences in sorucedata for AD_Field

hg diff src-db/database/sourcedata/AD_FIELD.xml | grep IGNOREINWAD | head
-<!--100--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--100--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--102--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--102--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--103--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--103--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--104--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--104--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--106--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--106--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>

hg diff src-db/database/sourcedata/AD_FIELD.xml | grep PROPERTY | head
-<!--04C160C8E39643CDB71809F64B71ABB1--> <PROPERTY><![CDATA[product.genericProduct]]></PROPERTY>
+<!--04C160C8E39643CDB71809F64B71ABB1--> <PROPERTY><![CDATA[product.genericProduct]]></PROPERTY>
-<!--0B6D4F88C0C04FFCA730D7115B17A298--> <PROPERTY><![CDATA[period.year]]></PROPERTY>
+<!--0B6D4F88C0C04FFCA730D7115B17A298--> <PROPERTY><![CDATA[period.year]]></PROPERTY>
-<!--18C2A1446F2A4F0C912873EA6754B668--> <PROPERTY><![CDATA[finPayment.documentNo]]></PROPERTY>
+<!--18C2A1446F2A4F0C912873EA6754B668--> <PROPERTY><![CDATA[finPayment.documentNo]]></PROPERTY>
-<!--1DF093BB951F4CAEA844FF08843CD8D8--> <PROPERTY><![CDATA[reservationStock.storageBin]]></PROPERTY>
+<!--1DF093BB951F4CAEA844FF08843CD8D8--> <PROPERTY><![CDATA[reservationStock.storageBin]]></PROPERTY>
-<!--1FDD33B67C99472199B85894DA21E199--> <PROPERTY><![CDATA[product.name]]></PROPERTY>
+<!--1FDD33B67C99472199B85894DA21E199--> <PROPERTY><![CDATA[product.name]]></PROPERTY>


Steps To ReproduceInstall 2.50:
 hg clone pi
 hg up -C 2.50MP24
 ant install.source

Prepare to upgrade (fix some data):
  psql -c 'delete from C_BP_CUSTOMER_ACCT where C_BP_CUSTOMER_ACCT_id in ('\''1000020'\'', '\''1000019'\'', '\''1000024'\'', '\''1000022'\'', '\''1000021'\'');'

Upgrade
  ant smartbuild -Dlocal=no

Set all modules but template in development:
 psql -c 'update ad_module set isindevelopment='\''Y'\'' where ad_module_id<>'\''0138E7A89B5E4DC3932462252801FFBC'\'';'

Export database and check:
  ant export.database
  hg diff
    -> many source data files have changes regarding position of some columns
  

You can see this error in CI: https://ci.openbravo.com/job/up-2.50topi-pgsql/74 [^]
Proposed SolutionThere are no is to prevent these formal changes to appear after upgrade.

The proposal is to change the CI test to ignore the known changes:

* For model we could apply the reverse diff affecting only to the known columns in AD_Field and C_Acct_Default
* For sourcedata we should be able to skip modifications in all AD_FIELD.xml files affecting IGNOREINWAD and PROPERTY columns
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00299233.0PR15Q3 closedalostale upgrading from 2.50 to pi shows errors in update.database log 
caused by feature request 0029270 closedalostale prevent table recreation in update.database 

-  Notes
(0078048)
alostale (manager)
2015-06-04 09:42

Fixed by accepting those formal changes in the CI jobs.

- Issue History
Date Modified Username Field Change
2015-05-19 10:16 alostale New Issue
2015-05-19 10:16 alostale Assigned To => platform
2015-05-19 10:16 alostale Modules => Core
2015-05-19 10:16 alostale Regression level => Automated tests
2015-05-19 10:16 alostale Regression date => 2015-04-28
2015-05-19 10:16 alostale Regression introduced in release => pi
2015-05-19 10:16 alostale Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
2015-05-19 10:16 alostale Triggers an Emergency Pack => No
2015-05-19 10:16 alostale Relationship added caused by 0029270
2015-05-19 10:16 alostale Relationship added related to 0029923
2015-05-19 10:17 alostale Steps to Reproduce Updated View Revisions
2015-05-19 12:39 shuehner Issue Monitored: shuehner
2015-05-28 08:10 alostale Status new => acknowledged
2015-05-28 08:36 alostale Description Updated View Revisions
2015-05-28 08:36 alostale Proposed Solution updated
2015-05-28 08:37 alostale Proposed Solution updated
2015-06-04 09:41 alostale Status acknowledged => scheduled
2015-06-04 09:41 alostale Assigned To platform => alostale
2015-06-04 09:42 alostale Note Added: 0078048
2015-06-04 09:42 alostale Status scheduled => closed
2015-06-04 09:42 alostale Resolution open => fixed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker