Are there any options in MySQL Workbench to draw the relationship-line between the columns and not the tables? If i export my diagram as JPG i can't see, which columns are foreign keys and who they are related to.
On the screenshot, you can't see, that id and user_id are connected.
To see foreign key relationships of a column: SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA. KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = 'db_name' AND REFERENCED_TABLE_NAME = 'table_name' AND REFERENCED_COLUMN_NAME = 'column_name';
(To view all the relationships in the sakila database, see Figure 9.35, “The sakila Database EER Diagram”.) Click the Properties tab of the panel on the lower left and then click one of the tables on the canvas. This action displays the properties of the table in the Properties window, as the next figure shows.
To create a relationship in MySQL Workbench: Create a database model (either create a new model or reverse engineer an existing database) Viewing the database model, double click on the first table of the relationship. The bottom pane will open with the table details.
You can create relationships between columns in different tables in the Diagram Designer by dragging columns between tables. In Database Designer, click the row selector for one or more database columns that you want to relate to a column in another table. Drag the selected column(s) to the related table.
You can create relationships between columns in different tables in the Diagram Designer by dragging columns between tables. To create a relationship graphically In Database Designer, click the row selector for one or more database columns that you want to relate to a column in another table. Drag the selected column (s) to the related table.
The image above shows lines between each colored column, here is how to add them automatically to your chart. Select chart. Go to tab "Design" on the ribbon. Press with left mouse button on "Add Chart Element" button. Press with left mouse button on "Lines". Press with left mouse button on "Series Lines".
If you’d like to add a vertical line between the columns, open the Columns dialog box. Choose Page Layout > Columns. At the bottom of the list, choose More Columns. In the Columns dialog box, select the check box next to Line between. You can also use the Columns dialog box to adjust the column width and the spacing between columns.
In the main menu bar go to: Model -> Relationship Notation -> Connect to columns.
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