I have a database with different movies, actors, directors.
To connect a director with a movie I'm using a table in which I have the following:
film_id and director_id - so when I add a director for the movie the necessary id's get inserted to this table.
So I have a bunch of id's already there and it works just fine. For example:
movie_id - director_id
10 15
11 17
9 13
Now when I add another director with let's say an id 9 to a movie with an id 13 then I have two rows that are exactly the same and that's what I don't want to happen. Shown below:
movie_id - director_id
10 15
11 17
9 13
9 13
Instead it should not insert when there already is a row with the same film_id equal to the same director_id.
How can I prevent this from happening?