Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 0530c6d

Browse files
committed
fix migrations
1 parent cde5737 commit 0530c6d

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

push_notifications/migrations/0001_initial.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
# -*- coding: utf-8 -*-
2-
from django.conf import settings
32
from django.db import migrations, models
43

54
import push_notifications.fields
65

6+
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
77

8-
class Migration(migrations.Migration):
98

10-
dependencies = [
11-
migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS),
12-
]
9+
class Migration(migrations.Migration):
1310

14-
USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"]
11+
USER_MODEL = SETTINGS["USER_MODEL"]
1512

1613
operations = [
1714
migrations.CreateModel(

push_notifications/migrations/0003_wnsdevice.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# -*- coding: utf-8 -*-
22
# Generated by Django 1.9.6 on 2016-06-13 20:46
33
import django.db.models.deletion
4-
from django.conf import settings
54
from django.db import migrations, models
65

6+
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
7+
78

89
class Migration(migrations.Migration):
910

1011
dependencies = [
11-
migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS),
1212
('push_notifications', '0002_auto_20160106_0850'),
1313
]
1414

15-
USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"]
16-
1715
operations = [
1816
migrations.CreateModel(
1917
name='WNSDevice',
@@ -24,7 +22,7 @@ class Migration(migrations.Migration):
2422
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Creation date')),
2523
('device_id', models.UUIDField(blank=True, db_index=True, help_text='GUID()', null=True, verbose_name='Device ID')),
2624
('registration_id', models.TextField(verbose_name='Notification URI')),
27-
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=USER_MODEL)),
25+
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=SETTINGS["USER_MODEL"])),
2826
],
2927
options={
3028
'verbose_name': 'WNS device',

push_notifications/migrations/0004_fcm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# -*- coding: utf-8 -*-
22
# Generated by Django 1.9.6 on 2016-06-13 20:46
3-
from django.conf import settings
43
from django.db import migrations, models
54

65

76
class Migration(migrations.Migration):
87

98
dependencies = [
10-
migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS),
119
('push_notifications', '0003_wnsdevice'),
1210
]
1311

push_notifications/migrations/0006_webpushdevice.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# -*- coding: utf-8 -*-
2-
from django.conf import settings
32
from django.db import migrations, models
43

4+
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
5+
56

67
class Migration(migrations.Migration):
78

89
dependencies = [
9-
migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS),
1010
('push_notifications', '0005_applicationid'),
1111
]
1212

13-
USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"]
14-
1513
operations = [
1614
migrations.CreateModel(
1715
name='WebPushDevice',
@@ -25,7 +23,7 @@ class Migration(migrations.Migration):
2523
('p256dh', models.CharField(max_length=88, verbose_name='User public encryption key')),
2624
('auth', models.CharField(max_length=24, verbose_name='User auth secret')),
2725
('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')])),
28-
('user', models.ForeignKey(blank=True, to=USER_MODEL, null=True, on_delete=models.CASCADE)),
26+
('user', models.ForeignKey(blank=True, to=SETTINGS["USER_MODEL"], null=True, on_delete=models.CASCADE)),
2927
],
3028
options={
3129
'verbose_name': 'WebPush device',

0 commit comments

Comments
 (0)