forked from source-academy/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing unique score constraint for contest entries from backend (in…
… preparation for frontend PR) (source-academy#938) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update assessments.ex * Update submission_votes.ex * Update submission_votes_test.exs
- Loading branch information
Showing
5 changed files
with
18 additions
and
67 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
11 changes: 11 additions & 0 deletions
11
priv/repo/migrations/20230331010500_remove_unique_score_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,11 @@ | ||
defmodule Cadet.Repo.Migrations.RemoveUniqueScoreConstraint do | ||
use Ecto.Migration | ||
|
||
def up do | ||
drop(unique_index(:submission_votes, [:user_id, :question_id, :score], name: :unique_score)) | ||
end | ||
|
||
def down do | ||
create(unique_index(:submission_votes, [:user_id, :question_id, :score], name: :unique_score)) | ||
end | ||
end |
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