Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql Workbench composite key in diagram

I have a model i'm building in workbench, and one of the tables is a many-many relationship table with a composite key made up of 3 integer values: the two foreign keys that make up the many-many relationship, and an additional identifier whose details are not relevant to my question.

I can see how in the model tab of the workbench I can tick off the checkbox to make all 3 values a component of the primary key (and it's index) and that seems to be working just fine, but when I go to the EER Diagram tab - I only see one of the columns with a key icon next to it.

Is there an additional step here, or is there something I'm missing?

EDIT: see attached screenshot - sorry about the yellow obscuring boxes - my company would not be pleased if I posted details, even on something so simple.

Screenshot of Diagram

like image 605
Mike Avatar asked Aug 26 '15 13:08

Mike


People also ask

How do I create a composite key in MySQL workbench?

If you wish to create a composite primary key you can select multiple columns and check the PK check box. However, there is an additional step that is required, you must click the Indexes tab, then in the Index Columns panel you must set the desired order of the primary keys.

What is composite key in ER diagram?

The attribute which uniquely identifies each entity in the entity set is called key attribute. For example, Roll_No will be unique for each student. In ER diagram, key attribute is represented by an oval with underlying lines. An attribute composed of many other attribute is called as composite attribute.

How do I find the composite key in MySQL?

You can use aggregate function count(*). If it returns a value greater than 1, that would mean the table has composite primary key.

How do you represent a composite key?

In a table representing students our primary key would now be firstName + lastName. Because students can have the same firstNames or the same lastNames these attributes are not simple keys. The primary key firstName + lastName for students is a composite key.


1 Answers

This is a bug that has been reported. See here: https://bugs.mysql.com/bug.php?id=92141

like image 159
dleerob Avatar answered Oct 13 '22 14:10

dleerob