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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043790
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 00. Application dictionaryminorhave not tried2020-04-20 13:412022-02-01 07:24
ReportershuehnerView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043790: Not possible to uninstall a module having grid config for a contained tab or field defined

DescriptionIf a grid config for a tab or field contained in a module exists in the database it is not possible to uninstall that module.

Problem are the 2 foreign-keys:
- obuiapp_gc_tab -> ad_tab
- obuiapp_gc_field -> ad_field

Which are not declared with onDeleteCascade.

For this use-case when deleting a module any custom grid-config should be probably delete as well instead of breaking the module-uninstall (current behavior).

Error is like this using steps below:
     [java] 30490 [main] INFO org.apache.ddlutils.platform.PGStandardBatchEvaluator - Batch statement failed. Rolling back and retrying all the statements in a non-batched connection.
     [java] 30923 [main] WARN org.apache.ddlutils.platform.PGStandardBatchEvaluator - SQL Command failed with: ERROR: insert or update on table "obuiapp_gc_field" violates foreign key constraint "obuiapp_gc_field_field"
     [java] Detail: Key (ad_field_id)=(0787AC0FCA6742AE91D991D2DF849052) is not present in table "ad_field".
     [java] 30924 [main] WARN org.apache.ddlutils.platform.PGStandardBatchEvaluator - -- END
     [java] ALTER TABLE OBUIAPP_GC_FIELD
     [java] ADD CONSTRAINT OBUIAPP_GC_FIELD_FIELD FOREIGN KEY (AD_FIELD_ID) REFERENCES AD_FIELD (AD_FIELD_ID)
     [java] 30927 [main] WARN org.apache.ddlutils.platform.PGStandardBatchEvaluator - SQL Command failed with: ERROR: insert or update on table "obuiapp_gc_tab" violates foreign key constraint "obuiapp_gc_tab_tab"
     [java] Detail: Key (ad_tab_id)=(14BDEAB664C146DCB662B2E3EA7A495E) is not present in table "ad_tab".
     [java] 30928 [main] WARN org.apache.ddlutils.platform.PGStandardBatchEvaluator - -- END
     [java] ALTER TABLE OBUIAPP_GC_TAB
     [java] ADD CONSTRAINT OBUIAPP_GC_TAB_TAB FOREIGN KEY (AD_TAB_ID) REFERENCES AD_TAB (AD_TAB_ID)

Steps To ReproduceIndirectly noticed with:
fresh pi with 2 modules on top
https://code.openbravo.com/erp/pmods/org.openbravo.warehouse.advancedwarehouseoperations [^]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core [^]

ant run.all.tests
That contains tests creating grid config apparently and leaving them present after the test

Delete the 2 modules cloned above
run update.database

Error about those 2 foreign keys here having non-compliant data is shown.

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2020-04-20 13:41 shuehner New Issue
2020-04-20 13:41 shuehner Assigned To => platform
2020-04-20 13:41 shuehner Modules => Core
2020-04-20 13:41 shuehner Triggers an Emergency Pack => No
2022-02-01 07:24 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker