Skip to content

Commit

Permalink
Edit old migrations to use new USER_MODEL setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
ezheidtmann committed Apr 28, 2022
1 parent 6fde730 commit eed5267
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions push_notifications/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import push_notifications.fields

from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS


class Migration(migrations.Migration):

Expand All @@ -21,7 +23,7 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date', null=True)),
('device_id', models.UUIDField(help_text='UDID / UIDevice.identifierForVendor()', max_length=32, null=True, verbose_name='Device ID', blank=True, db_index=True)),
('registration_id', models.CharField(unique=True, max_length=64, verbose_name='Registration ID')),
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
('user', models.ForeignKey(blank=True, to=SETTINGS["USER_MODEL"], null=True, on_delete=models.CASCADE)),
],
options={
'verbose_name': 'APNS device',
Expand All @@ -37,7 +39,7 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date', null=True)),
('device_id', push_notifications.fields.HexIntegerField(help_text='ANDROID_ID / TelephonyManager.getDeviceId() (always as hex)', null=True, verbose_name='Device ID', blank=True, db_index=True)),
('registration_id', models.TextField(verbose_name='Registration ID')),
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
('user', models.ForeignKey(blank=True, to=SETTINGS["USER_MODEL"], null=True, on_delete=models.CASCADE)),
],
options={
'verbose_name': 'GCM device',
Expand Down
3 changes: 2 additions & 1 deletion push_notifications/migrations/0003_wnsdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.conf import settings
from django.db import migrations, models

from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS

class Migration(migrations.Migration):

Expand All @@ -22,7 +23,7 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Creation date')),
('device_id', models.UUIDField(blank=True, db_index=True, help_text='GUID()', null=True, verbose_name='Device ID')),
('registration_id', models.TextField(verbose_name='Notification URI')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=SETTINGS["USER_MODEL"])),
],
options={
'verbose_name': 'WNS device',
Expand Down
3 changes: 2 additions & 1 deletion push_notifications/migrations/0006_webpushdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.conf import settings
from django.db import migrations, models

from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS

class Migration(migrations.Migration):

Expand All @@ -23,7 +24,7 @@ class Migration(migrations.Migration):
('p256dh', models.CharField(max_length=88, verbose_name='User public encryption key')),
('auth', models.CharField(max_length=24, verbose_name='User auth secret')),
('browser', models.CharField(default='CHROME', help_text='Currently only support to Chrome, Firefox and Opera browsers', max_length=10, verbose_name='Browser', choices=[('CHROME', 'Chrome'), ('FIREFOX', 'Firefox'), ('OPERA', 'Opera')])),
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
('user', models.ForeignKey(blank=True, to=SETTINGS["USER_MODEL"], null=True, on_delete=models.CASCADE)),
],
options={
'verbose_name': 'WebPush device',
Expand Down

0 comments on commit eed5267

Please sign in to comment.