Creating UNIQUE constraint on multiple columns in MySQL Workbench EER diagram

后端 未结 3 471
逝去的感伤
逝去的感伤 2021-01-31 14:12

In MySQL Workbench\'s EER diagram, there is a checkbox to make each column in a table unique, not null, primary key etc.

However, I would like to have a UNIQUE constrain

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-31 15:15

    With latest MWB (I'm on 6.0.8), it is possible to create composite keys

    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.

提交回复
热议问题