Toad World® Forums

In PER Domain change for PK in entity does not propagate (mysql)


#1

I have two entities connected by foreign key Pk => PFK.
My LER did not export without problems, chars lost their length/size.
My PK was domain. When I tried to change it to decimal(4,0), it changed for PK, but it did not change in PFK of second entity.

I tried it on new model and it’s the same. Even removing the relationship with attbite does not help, newly added relationship still has the old data type.

Then I tried simple test in new PER model.
Created two entities, one domain varchar(20).
Used domain for first attribute in entity1 and assigned key to it.
Dragged relationship to entity2 and the data type there was char instead of domain.

In my model, it generates errors - FK from domain is char with no size, but domain does have it defined. And is diferent type as well.
And cause it’s a FK, I can’t change it.


#2

Hello arki,

Unfortunately, I’ve failed to simulate the problem.
Firstly, I’d like to ask you to make sure that you have assigned the domain to the attribute properly - please see the Attribute Properties dialog | General tab | Domain box.

What I had and did:

  1. LER model:
  • Entity1 with Attribute1, M (PUI), Domain - Decimal(4,0) and Attribute2, Char (length 10)
  • identifying relationship
  • Entity2
  1. I do conversion to PER model MySQL5.
  2. MySQL model after conversion:
  • Entity1 with Attribute1, NN (PK), Domain - Decimal(4,0), Attribute2, Char (length 10)
    identifying relationship
    Entity2 with Attribute1, NN (PFK), Domain - Decimal(4,0)

If I open the Atribute 1 Properties dialog now, I can see:

  • Data type box should be empty.
  • Precision, Scale greyed with the options you defined for the domain.
  • Domain name in the Domain box.
    (Please see the screenshot attached.)
  1. I change the domain properties (Model | Domains).
  2. I check out the Attribute1PK in Entity1 and PFK in Entity2 - the change has been applied properly.

Then I tried simple test in new PER model. Created two entities, one domain varchar(20).Used domain for first attribute in entity1 and assigned key to it. Dragged relationship to entity2 and the data type there was char instead of domain.

I’ve taken exactly the same steps and it works for me.
Wondering where the problem is…

Anyway, please check it out again. If the problem remains, please send us your model. Thanks very much.

Regards,

Vladka


#3

Hello arki again,

Yes, it works properly, however not in current Beta 3.0.12. I’m very sorry. I was verifying it in our dev version of TDM3. My mistake.

Now I can confirm that this problem will be definitely fixed in next Beta. :wink:

Let me apologize again.

Regards,

Vladka


#4

I will try it again from fresh TDM3 run and model (MySQL 5)

  1. Opened TDM3
  2. New PER model Mysql 5 with the same name
  3. Added Entity 1 and Entity 2
  4. Model->Domains
    4.1. Add
    4.2. Apply
    4.3. Data type F2, changed to Decimal 4, 1
    4.4. Apply
    4.5. OK
  5. Open Entity 1->Attributes
    5.1. Add
    5.2. data type F2 , change it to Domain1, check not null
    5.3. apply
    5.4. change to TAB KEYS
    5.5. Edit Key1->attributes
    5.6. Select attribute 1, OK
    5.7 OK (closes entity)
  6. create non identifying relationship from entity 1 to entity 2
  7. Open entity 2, attributes
  8. Attribute1 is of data type “char” without any parameters. (should be domain1).
  9. we continue…
  10. Edit attribute1
  11. data type is grayed out because it is inherited from entity 1. But it is not only bad type, but also has no params. so that…
  12. press OK, messagebox will appear (see attached file)
  13. the funny part…
  14. Open model->domains-> edit domain1
  15. on tab you can see that it is used twice. If you change attribute1 in entity2 to attrB, you will see it there changed. So in project internal data files, it seems to be saved correctly, only the form for editing attributes of entity (for mysql?) seems to be broken if it is foreign key with domain data type.

By the way, we may not have the same version of TDM3, because when I open attribute1 in entity1 I see only that it uses domain1 but I do not see the precision as you do.

I will attach the whole model as well.

The (8) maybe results also into problems in my working project where the data types are domains.
entity2_attr1.png


#5

I will try it again from fresh TDM3 run and model (MySQL 5)

  1. Opened TDM3
  2. New PER model Mysql 5 with the same name
  3. Added Entity 1 and Entity 2
  4. Model->Domains
    4.1. Add
    4.2. Apply
    4.3. Data type F2, changed to Decimal 4, 1
    4.4. Apply
    4.5. OK
  5. Open Entity 1->Attributes
    5.1. Add
    5.2. data type F2 , change it to Domain1, check not null
    5.3. apply
    5.4. change to TAB KEYS
    5.5. Edit Key1->attributes
    5.6. Select attribute 1, OK
    5.7 OK (closes entity)
  6. create non identifying relationship from entity 1 to entity 2
  7. Open entity 2, attributes
  8. Attribute1 is of data type “char” without any parameters. (should be domain1).
  9. we continue…
  10. Edit attribute1
  11. data type is grayed out because it is inherited from entity 1. But it is not only bad type, but also has no params. so that…
  12. press OK, messagebox will appear (see attached file)
  13. the funny part…
  14. Open model->domains-> edit domain1
  15. on tab you can see that it is used twice. If you change attribute1 in entity2 to attrB, you will see it there changed. So in project internal data files, it seems to be saved correctly, only the form for editing attributes of entity (for mysql?) seems to be broken if it is foreign key with domain data type.

By the way, we may not have the same version of TDM3, because when I open attribute1 in entity1 I see only that it uses domain1 but I do not see the precision as you do.

I will attach the whole model as well.

The (8) maybe results also into problems in my working project where the data types are domains.
entity2_attr1_msgbox.png


#6

Here is the database model for this trouble.
domproblem.txp (17.4 KB)


#7

Yes arki,

In Beta 3.0.12, there is the bug. Thanks for your detailed report.

As I wrote previously, I tested it in our dev version by mistake.
Anyway, I’ve gone through your last example once again and can say it is solved for next Beta version.

Let me apologize for the inconveniences.

Arki, I feel very sorry I made you waste your time on this. Please forgive me.

Vladka
domproblem_fixed.txp (17.2 KB)