Added an unique constraint for the round_number of a bidding round to prevent multiple rounds with the same round number.
This commit is contained in:
@ -16,5 +16,6 @@ defmodule BeetRoundServer.BiddingRounds.BiddingRound do
|
|||||||
bidding_round
|
bidding_round
|
||||||
|> cast(attrs, [:round_number, :stopped])
|
|> cast(attrs, [:round_number, :stopped])
|
||||||
|> validate_required([:round_number, :stopped])
|
|> validate_required([:round_number, :stopped])
|
||||||
|
|> unique_constraint(:round_number)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user