add uniqueness constraint to votes to deduplicate

This commit is contained in:
Kiara Grouwstra 2023-01-24 16:17:53 +01:00
parent 8b96fa7637
commit 3193daf664
1 changed files with 1 additions and 0 deletions

View File

@ -9,5 +9,6 @@ class CreateVotes < ActiveRecord::Migration[6.0]
t.timestamps
end
add_index :votes, [:user_id, :election_slug], unique: true
end
end