This commit is contained in:
Egor Matveev
2022-01-20 00:48:23 +03:00
parent 39a61ba1d6
commit a09ec5234a
10 changed files with 94 additions and 0 deletions

View File

@@ -6,3 +6,9 @@ class Friendship(models.Model):
from_user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="from_friendship")
to_user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="to_friendship")
verified = models.BooleanField(default=False)
class Meta:
indexes = [
models.Index(fields=['from_user']),
models.Index(fields=['to_user'])
]