title: Ecto Join Table Validation
body: <p>I have this join table called: <code>seasons_teams</code></p>
  
  <pre><code>  schema "seasons_teams" do
      field(:score, :integer)
      belongs_to(:season, Season, foreign_key: :season_id, type: :binary_id)
      belongs_to(:team, Team, foreign_key: :team_id, type: :binary_id)
  
      timestamps()
    end
  </code></pre>
  
  <p>This is great but I want to validate that duplicate of <code>season</code> and <code>team</code> can't exist.</p>
  
  <p>For example:</p>
  
  <pre><code>  %MyApp.SeasonsTeams{
      __meta__: #Ecto.Schema.Metadata&lt;:loaded, "seasons_teams"&gt;,
      id: "89ec0dbd-cc61-4ba9-8dcf-b86b858d2882",
      inserted_at: ~N[2019-11-10 00:58:27],
      score: nil,
      season: #Ecto.Association.NotLoaded&lt;association :season is not loaded&gt;,
      season_id: "79c4bd04-d362-495c-ab13-649b299c23e2",
      team: #Ecto.Association.NotLoaded&lt;association :team is not loaded&gt;,
      team_id: "b6c408ef-d48e-4de9-8a46-8ae7bb12b699",
      updated_at: ~N[2019-11-10 00:58:27]
    },
    %MyApp.SeasonsTeams{
      __meta__: #Ecto.Schema.Metadata&lt;:loaded, "seasons_teams"&gt;,
      id: "89a7fc61-6ce4-4a6d-a9dc-8e3494378e33",
      inserted_at: ~N[2019-11-10 00:58:37],
      score: nil,
      season: #Ecto.Association.NotLoaded&lt;association :season is not loaded&gt;,
      season_id: "79c4bd04-d362-495c-ab13-649b299c23e2",
      team: #Ecto.Association.NotLoaded&lt;association :team is not loaded&gt;,
      team_id: "b6c408ef-d48e-4de9-8a46-8ae7bb12b699",
      updated_at: ~N[2019-11-10 00:58:37]
    }
  </code></pre>
  
  <p>You can see that both of these records have the same <code>season_id</code> and the same <code>team_id</code> I don't want this to be possible. I'm curious if Phoenix/Elixir/Ecto provides a nice way to handle this case? Thank you!</p>