title: Data modeling in Prisma with relations
body: <p>I have a problem understanding relations and data-modeling in Prisma. I have an &quot;easy&quot; example about two users who can participate in a tennis game. So i have:</p>
  <pre><code>Model User {
    id      Int @id 
    name    String 
  }
  
  Model Game { 
    id        Int @id 
    player1   PlayerInGame
    player2   PlayerInGame
  }
  
  Model PlayerInGame {
    id      Int @id
    player  User
    game    Game
  }
  </code></pre>
  <p>It gives me this error:</p>
  <pre><code>Error validating model &quot;Game&quot;: Ambiguous relation detected. The fields `player1` and `player2` in model `Game` both refer to `PlayerInGame`. Please provide different relation names for them by adding `@relation(&lt;name&gt;).
  </code></pre>
  <p>How can i fix this?
  Thanks in advance.</p>
  <p>I tried to at a @relation field  as well, but that gave me the following error:</p>
  <pre><code>model Game {
    id        Int          @id @default(autoincrement())
    createdAt DateTime     @default(now())
    player1   PlayerInGame @relation(&quot;player1&quot;)
    player2   PlayerInGame  @relation(&quot;player2&quot;)
  }
  
  
  Error validating model &quot;Game&quot;: Automatic related field generation would cause a naming conflict. Please add an explicit opposite relation field.
  </code></pre>