Is it possible to have the combination of columns be Primary Key?

I have the following table:
Table UserProjectRoles {
user_id varchar(100) [ref: - users.user_id]
project_id varchar(100) [ref: - Projects.project_id]
role_id varchar(100) [ref: - Roles.role_id]
organization_id varchar(100) [ref: - organizations.organization_id]
joined_at timestamp [default: ‘current_timestamp()’]
// PRIMARY KEY (user_id, project_id, role_id, organization_id)
}

I want the combination of (user_id, project_id, role_id, organization_id) to be the primary key.

is it possible to depict this is dbDiagramIO. I read a lot community posts but couldn’t find anything similar.

1 Like

Hi @Tanveer_Aman ,

To create composite primary keys, you can refer to this doc. Please read it and let me know if it works for you :blush: