I define 2 entities in Logical design (let’s say “users” and “forums”). I use “id” as primary key name for both users and forums.
Hence, I define a many-to-many relationship between users and forums.
When I convert to physical model, I obtain a join table “users_forums”.
The questions are:
How can I obtain “forums_users” instead? I’m using the resulting database with a framework who smartly use the convention “in join tables the two table names are sorted”
I obtain a table with 2 attributes called id, which will obviously break sql rules. Instead, I’d like to have a join tables with, let’s say, “id_user” and “id_forum” or “forum” and “user” or “forum_id” and “user_id” or whatever.
A clearer example of this problem is a logical entity with a self-relationship.
For example, suppose you have an entity User(id, name, surname) and you want to define a relationship between Users: you can add a non-identitying relationship between User and itself.
Unfortunately, when you convert the logical model to physical model you get a table User(id, name, surname, id) which is obviously incorrect.
My question is: where can I set the name of the foreign key generated by a logical relationship?
If you want to change the FK attribute name, edit the attribute (in PER model) and change its caption and name - the Parent Attributes (rolename) feature.
Please see the Help file | Index tab and type ‘parent attribute’.
If you have any questions, please write me back. Thanks.
Hi Vladka,
thanks for the reply.
Yes, of course in PER model changing the attribute is trivial, but I have to repeat this change manually everytime I convert from LER to PER.
My question was about setting that name in LER.
Unfortunately, it is not possible to set the name in LER.
I’m afraid, we don’t have a solution to this problem now. Anyway, we will deal with it - CR # 60 689.