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 committed Jan 12, 2024
1 parent 7004adf commit d2c5703
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 d2c5703

Please sign in to comment.