S
S
Sergey Gutovsky2018-08-25 16:29:24
Database design
Sergey Gutovsky, 2018-08-25 16:29:24

How to implement relationships?

There is a table with audio records Audio - id | name | slug:. Audio has owners and members and is stored in the people table. What is the best way to link audio to people
The first option is to make tables

audio_owners - audio_id | owner_id ;
audio_members - audio_id | member_id .

The second option is to implement roles, that is, entries will be stored in the roles table:
id - 1 | name - 'Owner', 
id - 2 | name - 'Member

Next - the audio_people_roles table, it will have the following structure:
id | audio_id | person_id | role_id
So the audio will be associated with people and the role will be indicated
Which option is better?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question