-
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add db_index=True for registration_id on APNSDevice model
When having huge list apns devices without the unique setting activated (UNIQUE_REG_ID) updating devices via the drf-endpoint becomes very slow. Adding an index resolves that.
- Loading branch information
1 parent
222a515
commit 8aacda7
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
push_notifications/migrations/0011_alter_apnsdevice_registration_id.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.db import migrations, models | ||
|
||
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('push_notifications', '0010_alter_gcmdevice_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='apnsdevice', | ||
name='registration_id', | ||
field=models.CharField(db_index=not SETTINGS['UNIQUE_REG_ID'], unique=SETTINGS['UNIQUE_REG_ID'], max_length=200, verbose_name='Registration ID'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters