-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix empty submisisons creation for team assessments (#1202)
* feat: Implement unique index for team-assessment in submissions * fix: Fix creation of empty submission for teams * chore: Negate the if statement * chore: Format * Let Elixir do its magic * fix: Duplicate team submissions being created --------- Co-authored-by: Richard Dominick <[email protected]>
- Loading branch information
1 parent
945db2c
commit d7c147f
Showing
3 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
priv/repo/migrations/20241014200600_create_teams_submission_constraint.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
defmodule Cadet.Repo.Migrations.CreateTeamsSubmissionConstraint do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create(index(:submissions, :team_id)) | ||
create(unique_index(:submissions, [:assessment_id, :team_id])) | ||
end | ||
end |