Remove db_index, add meta index

This commit is contained in:
zandercymatics 2024-05-06 14:19:25 -06:00
parent aa9ec2d716
commit 24a18f1562
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 31 additions and 13 deletions

View file

@ -24,6 +24,15 @@ logger = logging.getLogger(__name__)
class DomainRequest(TimeStampedModel):
"""A registrant's domain request for a new domain."""
class Meta:
"""Contains meta information about this class"""
indexes = [
models.Index(fields=["requested_domain"]),
models.Index(fields=["approved_domain"]),
models.Index(fields=["status"]),
models.Index(fields=["generic_org_type"]),
]
# https://django-auditlog.readthedocs.io/en/latest/usage.html#object-history
# If we note any performace degradation due to this addition,
# we can query the auditlogs table in admin.py and add the results to
@ -537,7 +546,6 @@ class DomainRequest(TimeStampedModel):
organization_name = models.CharField(
null=True,
blank=True,
db_index=True,
)
address_line1 = models.CharField(
@ -566,7 +574,6 @@ class DomainRequest(TimeStampedModel):
null=True,
blank=True,
verbose_name="zip code",
db_index=True,
)
urbanization = models.CharField(
null=True,