Skip to content

Commit

Permalink
perf: added indexes for fields in goods model
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-lymar committed Jun 29, 2024
1 parent 51ec1ee commit 730b450
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions goods/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ class Product(models.Model):
brand = models.ForeignKey(
"Brand", on_delete=models.PROTECT, related_name="brand_goods", db_index=True
)
package = models.ForeignKey("Package", on_delete=models.PROTECT, related_name="package_goods")
price = models.DecimalField(max_digits=10, decimal_places=2, verbose_name="Цена, руб./тн")
package = models.ForeignKey(
"Package", on_delete=models.PROTECT, related_name="package_goods", db_index=True
)
price = models.DecimalField(
max_digits=10, decimal_places=2, verbose_name="Цена, руб./тн", db_index=True
)

class Meta:
verbose_name = "Товар"
Expand Down

0 comments on commit 730b450

Please sign in to comment.