From 04c79d341c1e3c7e5990d1072f9f481220fd6d20 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Thu, 12 Feb 2026 12:08:13 +0100 Subject: [PATCH] Added an unique constraint for the round_number of a bidding round to prevent multiple rounds with the same round number. --- lib/beet_round_server/bidding_rounds/bidding_round.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/beet_round_server/bidding_rounds/bidding_round.ex b/lib/beet_round_server/bidding_rounds/bidding_round.ex index 6839123..10dd378 100644 --- a/lib/beet_round_server/bidding_rounds/bidding_round.ex +++ b/lib/beet_round_server/bidding_rounds/bidding_round.ex @@ -16,5 +16,6 @@ defmodule BeetRoundServer.BiddingRounds.BiddingRound do bidding_round |> cast(attrs, [:round_number, :stopped]) |> validate_required([:round_number, :stopped]) + |> unique_constraint(:round_number) end end