Skip to content

Commit 83eb89c

Browse files
committed
Add db_index to device_id field
Fixes jazzband#126
1 parent b2ce919 commit 83eb89c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

push_notifications/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class GCMDevice(Device):
4545
# device_id cannot be a reliable primary key as fragmentation between different devices
4646
# can make it turn out to be null and such:
4747
# http://android-developers.blogspot.co.uk/2011/03/identifying-app-installations.html
48-
device_id = HexIntegerField(verbose_name=_("Device ID"), blank=True, null=True,
48+
device_id = HexIntegerField(verbose_name=_("Device ID"), blank=True, null=True, db_index=True,
4949
help_text=_("ANDROID_ID / TelephonyManager.getDeviceId() (always as hex)"))
5050
registration_id = models.TextField(verbose_name=_("Registration ID"))
5151

@@ -77,7 +77,7 @@ def send_message(self, message, **kwargs):
7777

7878

7979
class APNSDevice(Device):
80-
device_id = UUIDField(verbose_name=_("Device ID"), blank=True, null=True,
80+
device_id = UUIDField(verbose_name=_("Device ID"), blank=True, null=True, db_index=True,
8181
help_text="UDID / UIDevice.identifierForVendor()")
8282
registration_id = models.CharField(verbose_name=_("Registration ID"), max_length=64, unique=True)
8383

0 commit comments

Comments
 (0)