Toad World® Forums

BUG: Invalid and undeletable keys in models

I observed this problem probably two years ago and now that I’m back into using TDM again I notice that this STILL hasn’t been fixed. Isn’t it about time?

The problem is in the “Keys” tab of the Entity properties, where “Keys” are listed. When making changes to e.g. the PK’s of a table - either by RENAMING or by unmarking the column as a PK - old keys often/always are still erroneously listed in this Keys list. Not only should they AUTOMATICALLY be removed, they are not even MANUALLY deletable. I couldn’t find a way to get rid of these erroneous references short of blowing away the column and recreating it. That does remove the erroneous key reference.

I’ve now noticed that columns marked as “unique” are apparently automatically placed in this “key” tab. Why should simply marking a column with a unique constraint automatically mark it as a “key”?

Message was edited by: Olivercomputing

Message was edited by: Olivercomputing

Hi,

this is not a bug, this way it was designed. When you mark attribute as Unique, new alternate key is created automatically. When you draw relationship between tables where parent has alternate key and edit the relationship, on tab Foreign Keys you can find combo box Parent Key where primary key as well as all alternate keys are listed.

For users interested in making relationship via unique item it should be a timesaver. Create attribute, mark it as Unique item, draw relationship and select the automatically created alternate key.

What should be improved is the management of keys. Currently, if you want to delete the automatically created alternate key you must edit the attribute and uncheck the Unique checkbox. What makes sense is to allow you to delete the key and uncheck the Unique checkbox automatically.

Similar situation is with Foreign Key attributes. When you edit entity and select FK attribute, it is not deleteable. To delete it, you must delete the relationship. Our plan is to improve it to make the item deleteable from the grid.

We are working on various changes in UI. I cannot confirm we will manage to make it in time for the next commercial release, but the changes described above are on our to do list with higher priority than plenty of other requirements.

Regards,

Vaclav

Ok, I’m glad it’s on your fix-it list, because it is very confusing and problematic (e.g. bad/broken script generation, other errors flagged) if you don’t know the tricks to fix it.

Also, I believe you’ve missed an outright bug that I noted originally. If you change the name of a PK column, the previously autogenerated key reference is NOT changed. I don’t see any way to rationalize that other than: bug.

Message was edited by: Olivercomputing

Hi,

can you send us your model to modeling@quest.com, please? The talk was about alternate key that TDM creates when you mark attribute as Unique item. If you change name of PK column, the change will appear in PK key, not in alternate key.

Please send me your model and let me know what attribute you renamed and what did you expect. Thanks a lot!

Regards,

Vaclav