Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0045728 | Openbravo ERP | Y. DBSourceManager | public | 2021-01-13 17:34 | 2022-02-01 07:24 |
Reporter | shuehner | ||||
Assigned To | Triage Platform Base | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0045728: update.database fails when renaming the primaryKey of a table definition in the xml file | ||||
Description | Database element names should follow module naming convention and in case of fixing old modules sometime names will be 'fixed' to comply with them. Renaming the primaryKey name of a table in any src-db/datbase/tables/<TABLENAME>.xml file makes update.database fails with SQL error trying to apply those. Scenarios below tested with master >21Q1 and pg10 and oracle19 2 specific sub-problems a.) On postgresql: [java] ALTER TABLE AD_TABLE [java] ADD CONSTRAINT AD_TABLE_KEY_NEW PRIMARY KEY (AD_TABLE_ID) Happens on any rename of the primary key. Apparently logic does not support this as apparently it is missing to drop the old pk constraint first ? b.) oracle and pk has incoming fk [java] 94900 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - SQL Command failed with: ORA-02273: this unique/primary key is referenced by some foreign keys [java] [java] 94900 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - ALTER TABLE AD_TABLE [java] DROP PRIMARY KEY DROP INDEX [java] 94908 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - SQL Command failed with: ORA-02260: table can have only one primary key [java] [java] 94909 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - -- END [java] ALTER TABLE AD_TABLE [java] ADD CONSTRAINT AD_TABLE_KEY_NEW PRIMARY KEY (AD_TABLE_ID) drop index fails as there is a foreign key from other table still pointing to the pk Then 2nd error is same as in case a.) above c.) Oracle when there is no incoming foreign key In this case the renaming works without a problem as can be tested editing primaryKey for example for the AD_SESSION_USAGE_AUDIT table | ||||
Steps To Reproduce | install.source of unmodified sources edit table xml file for the tables seen in the cases above and rename the value of primaryKey (2nd line in xml file) to a different name run update.database to apply the changed xml file | ||||
Proposed Solution | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2021-01-13 17:34 | shuehner | New Issue | |||
2021-01-13 17:34 | shuehner | Assigned To | => platform | ||
2021-01-13 17:34 | shuehner | Modules | => Core | ||
2021-01-13 17:34 | shuehner | Triggers an Emergency Pack | => No | ||
2022-02-01 07:24 | alostale | Assigned To | platform => Triage Platform Base |
There are no notes attached to this issue. |