Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036137Openbravo ERPY. DBSourceManagerpublic2017-05-30 14:132017-09-21 16:50
adrianromero 
inigosanchez 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q4 
AugustoMauch
Core
No
0036137: [SER-QA 2918] Config script removeCheckChange are not applied on install.source
configScript entries that remove check constraints are not applied on install.source.

Executing the build task install.source with sample data that does not comply with a check constraint removed in a configScript.xml file throws an error. In any case, the build tasks ends with a success message
* Clone a pi repository
* Configure the Openbravo.properties file
* Apply the attacked diff dbsourcemanager-removecheck.diff to force the error. This changeset does the following:
** Modifies configScript.xml to remove a check constraint
** Modifies sample date to fail if the previous check constraint is activated.
* Execute the build task install.source
* Observe the build task ends successfully but the following error appears in the build log. The log is attached.

Enabling constraints...
   Enabling check constraints
Batch statement failed. Rolling back and retrying all the statements in a non-batched connection.
SQL Command failed with: ERROR: la restricción «check» «a_amortization_isactive_check» es violada por alguna fila
-- END
ALTER TABLE A_AMORTIZATION
    ADD CONSTRAINT A_AMORTIZATION_ISACTIVE_CHECK CHECK (ISACTIVE IN ('Y', 'N'))
Executed 2362 SQL command(s) with 1 error(s)

If afterwards, update.database is executed, the constraint is removed.
SER-QA
related to defect 0032921 closed inigosanchez Openbravo ERP Constraint and trigger remain after being eliminated in a template 
related to defect 0030489 closed inigosanchez Openbravo ERP configScript(retail.pack) seems not applied when doing install.source 
has duplicate defect 0010839 closed marvintm Modules REMOVE CONSTRAINTS ON TABLES C_BANK, C_BANKACCOUNT 
related to defect 0036112 closed inigosanchez Openbravo ERP excludeFilter + manual db object creation does not work when installing module during install.source 
related to design defect 0034102 closed platform Openbravo ERP Update.database and Install.Source tasks should use the same flow to create the database and the db model 
causes defect 0036902 closed inigosanchez Openbravo ERP Update.database fails under some circumstances if a model change is defined 
causes defect 0036950 closed inigosanchez Openbravo ERP CheckAPIDistribution task is not working as expected 
diff dbsourcemanager-removecheck.diff (1,517) 2017-05-30 14:13
https://issues.openbravo.com/file_download.php?file_id=10811&type=bug
txt installsource.txt (117,046) 2017-05-30 14:13
https://issues.openbravo.com/file_download.php?file_id=10812&type=bug
Issue History
2017-05-30 14:13adrianromeroNew Issue
2017-05-30 14:13adrianromeroAssigned To => platform
2017-05-30 14:13adrianromeroModules => Core
2017-05-30 14:13adrianromeroResolution time => 1497304800
2017-05-30 14:13adrianromeroTriggers an Emergency Pack => No
2017-05-30 14:13adrianromeroFile Added: dbsourcemanager-removecheck.diff
2017-05-30 14:13adrianromeroFile Added: installsource.txt
2017-05-30 14:14adrianromeroSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15239#r15239
2017-05-30 14:14adrianromeroProposed Solution updated
2017-05-30 14:15adrianromeroSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15240#r15240
2017-05-30 14:15adrianromeroTag Attached: SER-QA
2017-05-30 14:21adrianromeroSummaryConfig script entries removeCheckChange are not properly processed => [SER-QA 2918] Config script entries removeCheckChange are not properly processed
2017-06-02 11:26alostaleSummary[SER-QA 2918] Config script entries removeCheckChange are not properly processed => [SER-QA 2918] Config script removeCheckChange are not applied on install.source
2017-06-02 11:26alostaleDescription Updatedbug_revision_view_page.php?rev_id=15275#r15275
2017-06-02 11:26alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15276#r15276
2017-06-02 11:26alostaleStatusnew => acknowledged
2017-06-02 11:27alostaleRelationship addedrelated to 0036112
2017-06-05 13:31inigosanchezStatusacknowledged => scheduled
2017-06-05 13:31inigosanchezAssigned Toplatform => inigosanchez
2017-06-05 19:23inigosanchezRelationship addedblocks 0010839
2017-06-05 19:23inigosanchezRelationship deletedblocks 0010839
2017-06-05 19:23inigosanchezRelationship addedrelated to 0010839
2017-06-06 17:43inigosanchezRelationship addedrelated to 0034102
2017-06-08 13:11inigosanchezRelationship replacedhas duplicate 0010839
2017-06-08 19:37inigosanchezReview Assigned To => caristu
2017-06-08 19:40hgbotCheckin
2017-06-08 19:40hgbotNote Added: 0097253
2017-06-08 19:40hgbotCheckin
2017-06-08 19:40hgbotNote Added: 0097254
2017-06-08 20:46hgbotCheckin
2017-06-08 20:46hgbotNote Added: 0097256
2017-06-08 20:46hgbotStatusscheduled => resolved
2017-06-08 20:46hgbotResolutionopen => fixed
2017-06-08 20:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^]
2017-06-09 02:49hudsonbotCheckin
2017-06-09 02:49hudsonbotNote Added: 0097266
2017-06-12 12:21hgbotCheckin
2017-06-12 12:21hgbotNote Added: 0097305
2017-06-12 20:03caristuNote Added: 0097329
2017-06-12 20:03caristuStatusresolved => new
2017-06-12 20:03caristuResolutionfixed => open
2017-06-13 10:05inigosanchezStatusnew => scheduled
2017-07-26 11:24alostaleRelationship addedrelated to 0032921
2017-08-10 11:33inigosanchezNote Added: 0098470
2017-09-07 12:37alostaleRelationship addedrelated to 0030489
2017-09-11 11:08inigosanchezNote Added: 0098933
2017-09-14 12:38hgbotCheckin
2017-09-14 12:38hgbotNote Added: 0099034
2017-09-14 12:38hgbotStatusscheduled => resolved
2017-09-14 12:38hgbotResolutionopen => fixed
2017-09-14 12:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^]
2017-09-14 12:38hgbotCheckin
2017-09-14 12:38hgbotNote Added: 0099035
2017-09-14 12:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^] => http://code.openbravo.com/erp/devel/pi/rev/d936b7f0882fc286f9244d241514a3d6cb8d3f48 [^]
2017-09-14 12:39inigosanchezReview Assigned Tocaristu => AugustoMauch
2017-09-15 11:02AugustoMauchNote Added: 0099063
2017-09-15 11:02AugustoMauchStatusresolved => closed
2017-09-15 11:02AugustoMauchFixed in Version => 3.0PR17Q4
2017-09-20 16:28inigosanchezRelationship addedcauses 0036902
2017-09-21 16:50hudsonbotCheckin
2017-09-21 16:50hudsonbotNote Added: 0099392
2017-09-26 10:08inigosanchezRelationship addedcauses 0036950

Notes
(0097253)
hgbot   
2017-06-08 19:40   
Repository: erp/devel/dbsm-main
Changeset: caf3e0060501d4d483ff097b34f22e4104707c17
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 19:35:10 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/caf3e0060501d4d483ff097b34f22e4104707c17 [^]

Related to bug 36137: Added test case and some clean up.

- A test has been added.
- Some code has been removed because update.database and Install.Source
tasks should use the same flow to create the database and the db model.
When the issue 0034102 will fixed this code would be obsolete.

---
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnDataChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnRequiredChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveIndexChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveTriggerChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptSuite.java
A src-test/model/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
A src-test/model/removeCheckChange/configScript.xml
A src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChangeConstraint.java
---
(0097254)
hgbot   
2017-06-08 19:40   
Repository: erp/devel/dbsm-main
Changeset: fc5a3b89948e267c597a5b0a8f5ab87f9c9ad4c0
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 19:39:16 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/fc5a3b89948e267c597a5b0a8f5ab87f9c9ad4c0 [^]

related to bug 36137:ConfigScript with removeCheckChange on installsource fails

When applying data changes (RemoveCheckChange) of a Configuration Script on install.source
the changes was not take into account and no errors thrown.

This happend because code for install.source task is different than update.database task.
A design defect issue 0034102 has been reported in order to fix this problem in a complete way.

The problem has been solved using the same logic which is being used on update.database. Now
applyConfigScriptModelChanges method is take into account RemoveCheckChange changes.

---
M src/org/apache/ddlutils/platform/PlatformImplBase.java
---
(0097256)
hgbot   
2017-06-08 20:46   
Repository: erp/devel/pi
Changeset: ab2414306cbc019eb9a8e6b93bc95448a74b74dd
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 20:46:16 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^]

Fixes issue 36137: ConfigScript with removeCheckChange on install.source fails

---
M src-db/database/lib/dbsourcemanager.jar
---
(0097266)
hudsonbot   
2017-06-09 02:49   
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/682983c2eead [^]
Maturity status: Test
(0097305)
hgbot   
2017-06-12 12:21   
Repository: erp/devel/dbsm-main
Changeset: 124639134186a84bc31bcf3ceb8c83acdf813250
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Mon Jun 12 12:20:23 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/124639134186a84bc31bcf3ceb8c83acdf813250 [^]

Related with issue 36137: Apply code review improvements to the test.

---
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptSuite.java
R src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChangeConstraint.java
---
(0097329)
caristu   
2017-06-12 20:03   
Problem still can be reproduced:

https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0098470)
inigosanchez   
2017-08-10 11:33   
Added a test in TestLink: Platform > [DBSM] DBSourceManager > ConfigScripts > RemoveCheckChange is not applied on install.source
(0098933)
inigosanchez   
2017-09-11 11:08   
Document all the API changes (logical or not):
-DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
-AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in configScript files while reading the model from XML files.
-CreateXML2SQL task is take into account model changes defined in configScript files.
-ImportSampledata task is take into account model changes defined in configScript files.
-Now CheckAPIDistribution task is take into account model changes defined in configScript files.
(0099034)
hgbot   
2017-09-14 12:38   
Repository: erp/devel/dbsm-main
Changeset: 5a5cd2a390fc17e319e4e52b080dc03ca4e64f75
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 14 12:23:40 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^]

Fixed issue 36137: Config scripts are not applied on install.source

The problem was that config scripts could not be applied on install source task at the same way
that update.database task. The problem was in ImportSampledata because this task was not be able
to load the database model applying the config script files. Now this problem has been fixed
because ImportSampledata task read the database model from xml taking into account any model
changes defined in the configScript files.

Besides, it have been implemented new model changes unsupported till now: RemoveTriggerChange,
RemoveIndexChange, ColumnRequiredChange and RemoveCheckChange.

This fix introduced also some important changes:
- DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
- AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in
configScript files while reading the model from XML files.
- CreateXML2SQL task is take into account model changes defined in configScript files.
- ImportSampledata task is take into account model changes defined in configScript files.
- Now CheckAPIDistribution task is take into account model changes defined in configScript files.

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnDataChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnRequiredChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveIndexChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveTriggerChange.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
M src/org/openbravo/ddlutils/task/AlterXML2SQL.java
M src/org/openbravo/ddlutils/task/CheckAPI.java
M src/org/openbravo/ddlutils/task/CheckAPIDistribution.java
M src/org/openbravo/ddlutils/task/CreateDatabase.java
M src/org/openbravo/ddlutils/task/CreateXML2SQL.java
M src/org/openbravo/ddlutils/task/DatabaseUtils.java
M src/org/openbravo/ddlutils/task/ExportConfigScript.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
M src/org/openbravo/ddlutils/task/ExportSampledata.java
M src/org/openbravo/ddlutils/task/ImportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
A src-test/model/configScripts/columnRequiredChange/configScript.xml
A src-test/model/configScripts/columnSizeChange/configScript.xml
A src-test/model/configScripts/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
A src-test/model/configScripts/removeCheckChange/configScript.xml
A src-test/model/configScripts/removeIndexChange/configScript.xml
A src-test/model/configScripts/removeTriggerChange/BASE_MODEL_TRIGGER.xml
A src-test/model/configScripts/removeTriggerChange/configScript.xml
R src-test/model/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
R src-test/model/removeCheckChange/configScript.xml
---
(0099035)
hgbot   
2017-09-14 12:38   
Repository: erp/devel/pi
Changeset: d936b7f0882fc286f9244d241514a3d6cb8d3f48
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 14 12:37:20 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d936b7f0882fc286f9244d241514a3d6cb8d3f48 [^]

Fixes issue 36137: Config scripts are not applied on install.source

The problem was that config scripts could not be applied on install source task at the same way
that update.database task. The problem was in ImportSampledata because this task was not be able
to load the database model applying the config script files. Now this problem has been fixed
because ImportSampledata task read the database model from xml taking into account any model
changes defined in the configScript files.

Besides, it have been implemented new model changes unsupported till now: RemoveTriggerChange,
RemoveIndexChange, ColumnRequiredChange and RemoveCheckChange.

This fix introduced also some important changes:
-DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
-AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in
configScript files while reading the model from XML files.
-CreateXML2SQL task is take into account model changes defined in configScript files.
-ImportSampledata task is take into account model changes defined in configScript files.
-Now CheckAPIDistribution task is take into account model changes defined in configScript files.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099063)
AugustoMauch   
2017-09-15 11:02   
Code reviewed and verified: https://docs.google.com/spreadsheets/d/1UpyuAaM8FD9ga41HbCpjrEgaPp6jqVbMmgDoFd6xPqg/edit [^]
(0099392)
hudsonbot   
2017-09-21 16:50   
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/9750b78d3e5c [^]
Maturity status: Test