Skip to content

Commit

Permalink
Don't allow players to friend or foe themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic authored and Brutus5000 committed Jan 12, 2024
1 parent 7004adf commit ee486dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions migrations/V134__friends_and_foes_constraint.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DELETE FROM friends_and_foes WHERE user_id = subject_id;

ALTER TABLE friends_and_foes
ADD CONSTRAINT friends_and_foes_cannot_reference_self
CHECK (user_id <> subject_id);

0 comments on commit ee486dd

Please sign in to comment.