Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036847Retail ModulesStoreServerpublic2017-09-13 13:122017-09-18 10:40
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
 
mtaal
No
0036847: Check if there are local db changes before installing/updating/uninstalling SymmetricDS
The following tasks make model changes in the database, and update the checksum to prevent those changes from being detected in the update.database task:
- install.symmetric.ds
- uninstall.symmetric.ds
- update.symmetric.ds.configuration

Those tasks should not be executed if there are local changes in the database, because they can hide those local changes. They should check this, and only execute the task if:
- There are no local changes, or
- The -Dforce=yes parameter is set
- Run this in a clean database:
       select ad_db_modified('N')
- It should return 'N', because at this point there should be no local db changes
- alter a column, change it from nullable to not nullable or viceversa
- Run this command again, now it should return 'Y'
       select ad_db_modified('N')
- Run ant update.database. The task should fail because it detects local changes. We want to have the same behaviour in the SymmetricDS tasks.
- Execute the uninstall.symmetric.ds in the org.openbravo.replication.symmetricds.
- Run this command again
       select ad_db_modified('N')
- Now it returns 'N', when it should have returned 'Y' because of the change in the column. The uninstall.symmetric.ds task has rewritten the checksum, so the local change is not detected now.
Do not allow to execute the install/uninstall/update SymmetricDS task if there are local changes in the database unless the force parameter is set to true
No tags attached.
Issue History
2017-09-13 13:12AugustoMauchNew Issue
2017-09-13 13:12AugustoMauchAssigned To => AugustoMauch
2017-09-13 13:12AugustoMauchTriggers an Emergency Pack => No
2017-09-13 13:24AugustoMauchReview Assigned To => mtaal
2017-09-13 13:26hgbotCheckin
2017-09-13 13:26hgbotNote Added: 0099011
2017-09-13 13:26hgbotStatusnew => resolved
2017-09-13 13:26hgbotResolutionopen => fixed
2017-09-13 13:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/51bf02f1a78ce09707a5cf30be64985caf720013 [^]
2017-09-18 10:40mtaalNote Added: 0099094
2017-09-18 10:40mtaalStatusresolved => closed

Notes
(0099011)
hgbot   
2017-09-13 13:26   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 51bf02f1a78ce09707a5cf30be64985caf720013
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Sep 13 13:13:45 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/51bf02f1a78ce09707a5cf30be64985caf720013 [^]

Fixes issue 36847: SymmetricDS tasks check if there are local db changes

Now the following tasks will only be executed if there are no local changes in the database or if the -Dforce=yes option is included:
- install.symmetric.ds
- uninstall.symmetric.ds
- update.symmetric.ds.configuration

---
M build.xml
M src/org/openbravo/replication/symmetricds/task/AbstractSymmetricDsTask.java
M src/org/openbravo/replication/symmetricds/task/InstallSymmetricDsTask.java
M src/org/openbravo/replication/symmetricds/task/SymmetricDSTask_data.xsql
M src/org/openbravo/replication/symmetricds/task/UninstallSymmetricDsTask.java
M src/org/openbravo/replication/symmetricds/task/UpdateSymmetricDsTablesTask.java
---
(0099094)
mtaal   
2017-09-18 10:40   
Tested & reviewed