Book a Demo

Author Topic: [7.1] Cannot change type of a Foreign Key property  (Read 5002 times)

Emilio

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
[7.1] Cannot change type of a Foreign Key property
« on: March 10, 2009, 01:43:29 am »
I am working -among other things- on a data model. In this model I have several Data Modeling diagrams where I have drawn the necessary tables and their relationships.

In doing so I have discovered a bug and that is, if you change the type of the FK in the PK table, the FK property in the FK table remains with the OLD type and it cannot be changed!

Steps to reproduce:
1. Create a Data Modeling diagram
2. Create a new table, say TablePrimary
3. Create a PK in TablePrimary, say type "varchar(15)" named PrimaryID.
4. Create a new table, say TableForeign
5. Create a Fk in TableForeign named PrimaryID
6. Create a relationship between TableForeign to TablePrimary on TablePrimary.PrimaryID and TableForeign.PrimaryID

At this point you will see that TableForeign has a propery added with stereotype FK named FK_PrimaryID and type varchar. So far so good.

Now let's say we have decided -for reasons that are not relevant- to change the type of TablePrimary.PrimaryID from varchar to bigint. We see that even though the PK type has changed, the FK property in TableForeign still remains listed as "FK_PrimaryID(varchar)" instead of its new type "FK_PrimaryID(bigint)".

I am afraid there is no way to change that! if you go to TableForeign and select "Operations" you can then select FK_PrimaryID in the General tab but you can only change the Notes, the name, and the scope (a useless property in this case) but not the type!

This is a bug. :-/