Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0045728 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Openbravo ERP] Y. DBSourceManager | minor | have not tried | 2021-01-13 17:34 | 2022-02-01 07:24 | |||||||
Reporter | shuehner | View Status | public | |||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | SCM revision | |||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
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 | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
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 |
Copyright © 2000 - 2009 MantisBT Group |