Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030016Openbravo ERPY. DBSourceManagerpublic2015-05-26 15:032015-06-04 15:44
alostale 
alostale 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR15Q33.0PR15Q3 
marvintm
Core
Automated tests
2015-04-28
pi
https://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
No
0030016: upgrading from 2.50 to pi some FKs are missing
When upgrading from 2.50 to pi, some FKs are missing in the new database.

This occurs for the FKs from recreated to non recreated tables in case none of them are in AD and also in case the both tables participating in the FK are recreated depending on the order they are loaded in the model.
Install 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 src-db/database/model/tables/MA_SEQUENCE_MACHINE.xmldiff -r b9ab1a7d0969 src-db/database/model/tables/MA_SEQUENCE_MACHINE.xml
--- a/src-db/database/model/tables/MA_SEQUENCE_MACHINE.xml Thu May 14 15:46:56 2015 +0000
+++ b/src-db/database/model/tables/MA_SEQUENCE_MACHINE.xml Tue May 26 15:01:04 2015 +0200
@@ -48,15 +48,6 @@
       <foreign-key foreignTable="AD_CLIENT" name="MA_SEQUENCE_MACHINE_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
- <foreign-key foreignTable="AD_ORG" name="MA_SEQUENCE_MACHINE_AD_ORG">
- <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
- </foreign-key>
- <foreign-key foreignTable="MA_MACHINE" name="MA_SEQUENCE_MACHINE_MA_MACHINE">
- <reference local="MA_MACHINE_ID" foreign="MA_MACHINE_ID"/>
- </foreign-key>
- <foreign-key foreignTable="MA_SEQUENCE" name="MA_SEQUENCE_MACHINE_MA_SEQUENC">
- <reference local="MA_SEQUENCE_ID" foreign="MA_SEQUENCE_ID"/>
- </foreign-key>
       <index name="MA_SEQUENCEMACHINE_SEQ_IDX" unique="false">
         <index-column name="MA_SEQUENCE_ID"/>
       </index>
No tags attached.
related to defect 00299233.0PR15Q3 closed alostale upgrading from 2.50 to pi shows errors in update.database log 
caused by feature request 0029270 closed alostale prevent table recreation in update.database 
Issue History
2015-05-26 15:03alostaleNew Issue
2015-05-26 15:03alostaleAssigned To => platform
2015-05-26 15:03alostaleModules => Core
2015-05-26 15:03alostaleRegression level => Automated tests
2015-05-26 15:03alostaleRegression date => 2015-04-28
2015-05-26 15:03alostaleRegression introduced in release => pi
2015-05-26 15:03alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
2015-05-26 15:03alostaleTriggers an Emergency Pack => No
2015-05-26 15:08alostaleRelationship addedrelated to 0029923
2015-05-26 15:10alostaleAssigned Toplatform => alostale
2015-05-26 15:10alostaleStatusnew => scheduled
2015-05-26 15:10alostaleSummary29923: upgrading from 2.50 to pi some FKs are missing => upgrading from 2.50 to pi some FKs are missing
2015-05-26 15:10alostaleRelationship addedcaused by 0029270
2015-05-27 14:55alostaleDescription Updatedbug_revision_view_page.php?rev_id=8674#r8674
2015-05-27 15:42hgbotCheckin
2015-05-27 15:42hgbotNote Added: 0077814
2015-05-27 15:42hgbotStatusscheduled => resolved
2015-05-27 15:42hgbotResolutionopen => fixed
2015-05-27 15:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f46b56001fbd6e4484652b2cf8c93fed0d6625e3 [^]
2015-05-27 15:43hgbotCheckin
2015-05-27 15:43hgbotNote Added: 0077815
2015-05-27 15:43hgbotCheckin
2015-05-27 15:43hgbotNote Added: 0077816
2015-05-27 15:43hgbotCheckin
2015-05-27 15:43hgbotNote Added: 0077817
2015-05-27 15:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f46b56001fbd6e4484652b2cf8c93fed0d6625e3 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/d5d21a543e48b1f3302c207b4d6c172755349245 [^]
2015-05-27 15:43alostaleReview Assigned To => marvintm
2015-05-28 01:10hudsonbotCheckin
2015-05-28 01:10hudsonbotNote Added: 0077843
2015-06-04 15:44marvintmStatusresolved => closed
2015-06-04 15:44marvintmFixed in Version => 3.0PR15Q3

Notes
(0077814)
hgbot   
2015-05-27 15:42   
Repository: erp/devel/pi
Changeset: f46b56001fbd6e4484652b2cf8c93fed0d6625e3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed May 27 15:41:58 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f46b56001fbd6e4484652b2cf8c93fed0d6625e3 [^]

fixed bug 30016: upgrading from 2.50 to pi some FKs are missing

  There were 2 scenarios where this occurred:
   * FKs from recreated to non recreated tables in case none of them are in AD
   * both tables participating in the FK are recreated and the referenced one
     is loaded before the referencing one in the model

---
M src-db/database/lib/dbsourcemanager.jar
---
(0077815)
hgbot   
2015-05-27 15:43   
Repository: erp/devel/dbsm-main
Changeset: d369daa5dda0a52109310b453143108afc63915d
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue May 26 15:13:15 2015 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/d369daa5dda0a52109310b453143108afc63915d [^]

related to bug 30016: upgrading from 2.50 to pi some FKs are missing

  added test case

---
M src-test/src/org/openbravo/dbsm/test/model/recreation/OtherRecreations.java
---
(0077816)
hgbot   
2015-05-27 15:43   
Repository: erp/devel/dbsm-main
Changeset: 386d20e998ca34f6af75a3665e09af65be42ae27
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed May 27 14:51:56 2015 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/386d20e998ca34f6af75a3665e09af65be42ae27 [^]

related to bug 30016: upgrading from 2.50 to pi some FKs are missing

  added more test cases covering different FK recreation scenarios

---
M src-test/src/org/openbravo/dbsm/test/model/recreation/OtherRecreations.java
A src-test/model/recreation/FK42.xml
A src-test/model/recreation/FK5.xml
A src-test/model/recreation/FK52.xml
---
(0077817)
hgbot   
2015-05-27 15:43   
Repository: erp/devel/dbsm-main
Changeset: d5d21a543e48b1f3302c207b4d6c172755349245
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed May 27 14:58:33 2015 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/d5d21a543e48b1f3302c207b4d6c172755349245 [^]

fixed bug 30016: upgrading from 2.50 to pi some FKs are missing

  There were 2 scenarios where this occurred:
   * FKs from recreated to non recreated tables in case none of them are in AD
   * both tables participating in the FK are recreated and the referenced one
     is loaded before the referencing one in the model

---
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0077843)
hudsonbot   
2015-05-28 01:10   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ae25da3bd47f [^]
Maturity status: Test