Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0000207Openbravo ERPY. DBSourceManagerpublic2008-05-08 10:062009-03-18 11:01
marvintm 
marvintm 
highmajorsometimes
closedfixed 
5
 
 
Core
No
0000207: Error while trying to change a table's primary key
Sometimes, when trying to change a table's primary key through a update.database task, the process fails, with a message similar to the following one:

[alterdatabase] SQL Command failed with: ORA-00955: name is already used by an existing object
[alterdatabase]
[alterdatabase] -- END
[alterdatabase] ALTER TABLE C_INVOICETAX
[alterdatabase] ADD CONSTRAINT C_INVOICETAX_KEY PRIMARY KEY (C_INVOICETAX_ID)

This problem is caused by an index associated to the previous primary key. This index has not been deleted, and prevents DBSourcemanager from creating the new primary key.

Sometimes this error can be reproduced by importing a previous database, changing the primary key of a table xml file (changing the columns, but not the primary key name), and doing an update.database.
dbsm_migrate
Issue History
2008-05-08 10:06marvintmNew Issue
2008-05-08 10:06marvintmAssigned To => marvintm
2008-05-08 10:10marvintmStatusnew => @40@
2008-05-08 10:10marvintmStatus@40@ => scheduled
2008-05-08 11:43marvintmStatusscheduled => resolved
2008-05-08 11:43marvintmResolutionopen => fixed
2008-05-08 11:43marvintmNote Added: 0000070
2008-11-26 14:12psarobeStatusresolved => closed
2008-12-18 12:38jpabloaeSticky IssueNo => Yes
2008-12-18 12:39jpabloaeSticky IssueYes => No
2008-12-18 12:39jpabloaeTag Attached: dbsm_migrate
2008-12-18 12:41jpabloaeProject@4@ => Openbravo ERP
2008-12-18 12:41jpabloaeCategory => Y. DBSourceManager
2009-03-18 11:01anonymoussf_bug_id0 => 2691234

Notes
(0000070)
marvintm   
2008-05-08 11:43   
Now in Oracle when dropping the Primary Key the index associated with it will be dropped as well, to prevent problems when trying to create a new Primary Key.