Editions are unique if name, platform OR year is different
All checks were successful
Django CI/CD / test (push) Successful in 1m25s
Django CI/CD / build-and-push (push) Successful in 1m20s

This commit is contained in:
2023-11-28 14:44:11 +01:00
parent 76fbc39fed
commit 6329d380b7
2 changed files with 18 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class Game(models.Model):
class Edition(models.Model):
class Meta:
unique_together = [["name", "platform"]]
unique_together = [["name", "platform", "year_released"]]
game = models.ForeignKey("Game", on_delete=models.CASCADE)
name = models.CharField(max_length=255)