Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0009776Openbravo ERP05. Production managementpublic2009-07-06 12:032009-07-16 17:55
joan 
rafaroda 
normalcriticalalways
closedduplicate 
30Debian Etch
2.50MP2 
 
Core
No
0009776: Upgrade 2.40 -> 2.50 Does not mantain the data on ma_sequenceproduct
When i try to upgrade from 2.40 to 2.50 everything goes smooth but the data on ma_sequenceproduct table disapear, im not sure if this happens because i've added a field called 'line' or if it does not do propertly the upgrade. But it is really critical for my update. (because there is data lose). Im not sure if this happens in another table, but should be checked.
Install 2.40
Create a Process Plan with io products
Upgrade from 2.40 to 2.50 following the wiki http://wiki.openbravo.com/wiki/ERP/2.50/Upgrading_From_2.40 [^]
see that there is no io produts on the list.
-------------------- If this works then
Install 2.40
Add a field called line in the database
Add the field to the io products tab in the window ProcessPlan
Create a Process Plan with io products, with line number completed
Upgrade from 2.40 to 2.50 following the wiki http://wiki.openbravo.com/wiki/ERP/2.50/Upgrading_From_2.40 [^]
see that there is no io produts on the list.
No tags attached.
depends on defect 0009650 closed marvintm Upgrade from 2.40 to 2.50MP1, foreign key changes update problem. 
Issue History
2009-07-06 12:03joanNew Issue
2009-07-06 12:03joanAssigned To => rafaroda
2009-07-10 12:08joanNote Added: 0018093
2009-07-10 12:08joanNote Edited: 0018093
2009-07-10 14:27joanNote Added: 0018107
2009-07-10 14:28joanNote Edited: 0018107
2009-07-13 13:30psarobeRelationship addeddepends on 0009650
2009-07-13 13:30psarobeStatusnew => closed
2009-07-13 13:30psarobeResolutionopen => duplicate
2009-07-16 17:55anonymoussf_bug_id0 => 2822586

Notes
(0018093)
joan   
2009-07-10 12:08   
Ob 2.40 , posgreSQL 8.3
>ant export.database
Buildfile: build.xml

init:

code.rev:
 [loadfile] /opt/newupgrade/Ob240Old/.svn/entries doesn't exist

export.database:

init:

database.lib:

clean:
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/build/classes
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/build/lib
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/docs

init:
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/build/classes
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/build/lib
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/docs

compile:
    [javac] Compiling 4 source files to /opt/newupgrade/Ob240Old/src-db/build/classes

build.jar:
      [jar] Building jar: /opt/newupgrade/Ob240Old/src-db/build/lib/dbmanager.jar

jar:
     [copy] Copying 1 file to /opt/newupgrade/Ob240Old/src-db/database/lib

export.database.structure:
[exportdatabase] Database code revision: 0008149#
[exportdatabase] Source code revision: #0#
[exportdatabase] Subversion code revision not found.
[exportdatabase] Reading tables...
[exportdatabase] Reading views...
[exportdatabase] Reading sequences...
[exportdatabase] Reading triggers...
[exportdatabase] Reading functions...
[exportdatabase] Sorting foreign keys and checks...
[exportdatabase] Starting function and trigger standardization.
[exportdatabase] Database [name=PostgreSql server; 424 tables; 0 sequences; 56 views; 231 functions; 163 triggers]

export.database.data:
[exportdata] Database code revision: 0008149#
[exportdata] Source code revision: #0#
[exportdata] Subversion code revision not found.
[exportdata] Reading tables...
[exportdata] Reading views...
[exportdata] Reading sequences...
[exportdata] Reading triggers...
[exportdata] Reading functions...
[exportdata] Sorting foreign keys and checks...
[exportdata] Starting function and trigger standardization.
[exportdata] Model loaded from database.

BUILD SUCCESSFUL
Total time: 2 minutes 31 seconds

>ant update.database
Buildfile: build.xml

init:

code.rev:
 [loadfile] /opt/newupgrade/Ob240Old/.svn/entries doesn't exist

update.database:

init:

database.lib:

clean:
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/build/classes
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/build/lib
   [delete] Deleting directory /opt/newupgrade/Ob240Old/src-db/docs

init:
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/build/classes
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/build/lib
    [mkdir] Created dir: /opt/newupgrade/Ob240Old/src-db/docs

compile:
    [javac] Compiling 4 source files to /opt/newupgrade/Ob240Old/src-db/build/classes

build.jar:
      [jar] Building jar: /opt/newupgrade/Ob240Old/src-db/build/lib/dbmanager.jar

jar:
     [copy] Copying 1 file to /opt/newupgrade/Ob240Old/src-db/database/lib

update.database:
[alterdatabasedata] Executing default prescript
[alterdatabasedata] Executed 108 SQL command(s) with 0 error(s)
[alterdatabasedata] Reading tables...
[alterdatabasedata] Reading views...
[alterdatabasedata] Reading sequences...
[alterdatabasedata] Reading triggers...
[alterdatabasedata] Reading functions...
[alterdatabasedata] Sorting foreign keys and checks...
[alterdatabasedata] Starting function and trigger standardization.
[alterdatabasedata] Original model loaded from database.
[alterdatabasedata] Processing View View [name=C_INVOICE_CANDIDATE_V; ] (created for the database PostgreSql server)
[alterdatabasedata] Executed 1 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 326 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 2148 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 68 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 154 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 326 SQL command(s) with 0 error(s)
[alterdatabasedata] Executed 2148 SQL command(s) with 0 error(s)
[alterdatabasedata] Processing View View [name=C_INVOICE_CANDIDATE_V; ] (created for the database PostgreSql server)
[alterdatabasedata] Executed 65 SQL command(s) with 0 error(s)
[alterdatabasedata] Executing default postscript
[alterdatabasedata] Executed 6 SQL command(s) with 0 error(s)

database.postcreate.POSTGRE:
      [sql] Executing commands
      [sql] 8 of 8 SQL statements executed successfully

BUILD SUCCESSFUL
Total time: 5 minutes 15 seconds

And my ma_sequenceproduct gets empty!.

(0018107)
joan   
2009-07-10 14:27   
(edited on: 2009-07-10 14:28)
Ok, solved!, it was my mistake, I've set the cascade setting on delete over a uom_id field , andlooks like when it does update.database cleans the table uom_id and deletes the table asociated because the ondeletecascade setting.
Sorry was my mistake
this is the "not use anymore constraint"
<foreign-key foreignTable="M_PRODUCT_UOM" name="MPRODUCTUOMID_MASEQPRODUCT" onDelete="cascade">
        <reference local="M_PRODUCT_UOM_ID" foreign="M_PRODUCT_UOM_ID"/>
      </foreign-key>

btw, this problems seams to be related with this issue
https://issues.openbravo.com/view.php?id=9650 [^]