Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: MaXyM on June 04, 2019, 11:49:16 pm
-
I'm trying to change Foreign Key label name. But it seems something is broken, or I cannot find proper place to change it.
I found two different places I can do that:
- double clicking on relation on diagram, then can change Foreign Key / Name
- Table Columns and Constraint (available for example from RMB over table in Browser and then Features/ Constraints/Indexes. Then the name can be changed directly in a list of constraints.
But none of those methods changes a label displayed on diagram. Right mouse clicking on the label, I can see "Edit label" option, but EA does nothing after selecting this. I cannot found any other place, where unchanged name is displayed to be able to change it.
Any suggestions?
-
If you know how, try updating the proper column in the t_connector or t_diagramlink table. There are several columns containing the connector label but some are used in some situations, so just try with some of them and it will work.
-
Thank you.
Yes I assume I can change it directly in database.
I'm asking rather for standard way of how to change the label, using EA GUI. If there is not - then I'm going to report it as a bug.
-
In v14 (and previous versions), assuming you are using Database Engineering, each foreign key constraint has 2 labels: one is the same of the primary key and the other is the name of the foreign key.
To change the label representing the name of the foreign key, double click on the constraint and change the Foreign Key\Name field.
to change the label representing the primary key, double click the table associated with the said primary key and change the name of the primary key constraint.
This works fine in v14. If you are using the v15 preview this is likely to be something to be fixed before v15 is released.
-
yea.. so it seems it's broken in in v15, cause as mentioned in OP changing FK name this way doesn't populate the change to connector label (reopening diagram doesn't help). This method works kinda partialy, changing FK operation name, but not the label.
Edit: I've checked in 14.1 (1427) and your method doesn't work too.
-
yea.. so it seems it's broken in in v15, cause as mentioned in OP changing FK name this way doesn't populate the change to connector label (reopening diagram doesn't help). This method works kinda partialy, changing FK operation name, but not the label.
Edit: I've checked in 14.1 (1427) and your method doesn't work too.
I tried the method described this morning with v14.1.1428 (this is build 1428) and it worked as described with a SQL Server database. What RDBMS are you using?
15 hasn't been released yet and it will a bit unfair to expect everything working fine.
-
I don't think it should does matter (unless there are inconsistencies injected to a model's underlying data by RE process)
It's model of postgresql database created by RE, maintained mainly by RE.
Anyway, I created new project with 2 SQL Server tables manually created. Created FK, and renamed it. Here is the result. All using EA v14.1
Here is the result.
(https://i.imgur.com/8a7g4e2.png)
-
Today I've got an answer from support, they are able to reproduce the issue.
-
Today I've got an answer from support, they are able to reproduce the issue.
Good, there is definitely a bug in here, one of this wonderful bugs that you can only find in Sparx EA. I have tried the same with 13 and 14 and I get inconsistent behaviour.
1st try with v14 resulted on the behaviour described on my reply to you, both the label at end the relationship line and the constrain name changed. However, when I tried to revert the change by renaming the constraint to its original name, it did exactly as you described: the constraint name changed but the label at the end of the relationship did not.
-
Recently I've sent to Sparx a screenshot and some notes. They answered:
Our developers have confirmed that this is a bug and it is logged to be fixed. We cannot yet say when (in which build) the fix will be implemented.
In addition I did some more experiments, hoping that the rename will work properly from Database Builder. It isn't. But it allow me to recognize a pattern. It seems that label is changed to name which was set just before the change. So if we change fk to fkname1, fkname2, fkname3 etc, the label label will be fkname2 when FK has index 3. And it's not a matter of refreshing diagram: reloading the project doesn't help.
However after that I noticed that I can fix the name using Columns/Constraints feature found in table context menu. Strange, since I reported it in OP as not working too.