diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-01 20:35:34 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-01 20:35:34 -0500 |
commit | 34e877d3328edd93b24bc82e63a89781d4350658 (patch) | |
tree | 412cab189ad11de06a654f83ac8d5c7ac034c776 /packages/models.py | |
parent | a87fe016d1a1bf7fdcd2b19f515aa72a5b93db2b (diff) |
Add indexes on 'created' field to several package-related models
These models regularly sort by or limit by the created field, so adding
a index on the created database column makes sense.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r-- | packages/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/models.py b/packages/models.py index 04f35f9d..2f03a28b 100644 --- a/packages/models.py +++ b/packages/models.py @@ -138,7 +138,7 @@ class Signoff(models.Model): arch = models.ForeignKey(Arch) repo = models.ForeignKey(Repo) user = models.ForeignKey(User, related_name="package_signoffs") - created = models.DateTimeField(editable=False) + created = models.DateTimeField(editable=False, db_index=True) revoked = models.DateTimeField(null=True) comments = models.TextField(null=True, blank=True) @@ -170,7 +170,7 @@ class FlagRequest(models.Model): ''' user = models.ForeignKey(User, blank=True, null=True) user_email = models.EmailField('email address') - created = models.DateTimeField(editable=False) + created = models.DateTimeField(editable=False, db_index=True) # Great work, Django... https://code.djangoproject.com/ticket/18212 ip_address = models.GenericIPAddressField(verbose_name='IP address', unpack_ipv4=True) @@ -246,7 +246,7 @@ class Update(models.Model): pkgbase = models.CharField(max_length=255) action_flag = models.PositiveSmallIntegerField('action flag', choices=UPDATE_ACTION_CHOICES) - created = models.DateTimeField(editable=False) + created = models.DateTimeField(editable=False, db_index=True) old_pkgver = models.CharField(max_length=255, null=True) old_pkgrel = models.CharField(max_length=255, null=True) |