I am editing a schema in MySQL workbench. I imported the schema from a mysqldump. Since it doesn't include any foreign keys, I am adding the relationships manually.
Here is my problem: When adding a relationship, workbench adds a column with the foreign key to one of the tables. However, the column is already present. I have to remove the current column and change the name of the new column to the name of the original column.
I illustrated it in the attached pictures:
Is there a way to avoid this, and choose the target-column when adding the relationship, so that I don't have to edit a larger number of tables?
(Edited to add: The example tables are not the tables I want to connect, in case somebody recognizes the Drupal 8 tables - they were just short enough to aid as an example).
Most of the relationship commands automatically create columns to host the new relationship. However, there's one tool that allows to select existing columns for a 1:n relationship. See in the tools toolbar. The last icon contains a picker symbol. This is the one to use. For quick access simply press '6'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With