Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit old migrations to use new USER_MODEL setting value #572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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