Index/key rename caution

vc

Member
If you edit a table, switch to the Keys tab, and change the name of a key, the ddl produced is:

-- Drop primary, unique and foreign key constraints
alter table CODES
drop constraint SYS_C002429 cascade;
-- Create/Recreate primary, unique and foreign key constraints
alter table CODES
add constraint PK_CODES primary key (CODE_ID)
using index
...

Isn't it a really bad idea to have the cascade option specifed without any warning? All refernecing foriegn keys are silently dropped.

It seems to me that the following is a better option:
alter table rename constraint SYS_C002429 to PK_CODES;
alter index SYS_C002429 rename to PK_CODES;

Similar drop/recreate statements are produced by the "Compare User Objects" tool.

Any chance of getting this behavior changed?

Thanks
 
Back
Top