Skip to content

Commit

Permalink
feat(pingpong): Tournament 모델 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
nyj001012 committed Jan 15, 2024
1 parent 6722b16 commit 89458bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/pingpong/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ class TwoPlayerGame(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)


class Tournament(models.Model):
player1_id = models.ForeignKey('users.User', on_delete=models.PROTECT, related_name='tournament_player1')
player2_id = models.ForeignKey('users.User', on_delete=models.PROTECT, related_name='tournament_player2')
player3_id = models.ForeignKey('users.User', on_delete=models.PROTECT, related_name='tournament_player3')
player4_id = models.ForeignKey('users.User', on_delete=models.PROTECT, related_name='tournament_player4')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

class Meta:
unique_together = ('player1_id', 'player2_id', 'player3_id', 'player4_id')

0 comments on commit 89458bf

Please sign in to comment.