Reputation: 12015
I have table OrdersPhoto
with two foreign keys: Order_Id
and Photo_Id
:
How to create a composed key based on them as: Order_Id__Photo_Id
using Workbench? Should it be additional field, or just set up primary key for each?
Upvotes: 0
Views: 528
Reputation: 53347
For the PK you can create the composite key by simply activating the checkboxes for all columns participating in that key. For all others (and alternatively also for the PK) use the index tab in the table editor.
]
Use the index details list to add and remove columns for a key. You can indicate the column order here too. Just change the number in the #
column.
Upvotes: 1