From 0530c6d09d15f5068c6122727477a1724da4a2fc Mon Sep 17 00:00:00 2001 From: Joey Orlando Date: Tue, 13 Dec 2022 09:15:42 +0100 Subject: [PATCH] fix migrations --- push_notifications/migrations/0001_initial.py | 9 +++------ push_notifications/migrations/0003_wnsdevice.py | 8 +++----- push_notifications/migrations/0004_fcm.py | 2 -- push_notifications/migrations/0006_webpushdevice.py | 8 +++----- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/push_notifications/migrations/0001_initial.py b/push_notifications/migrations/0001_initial.py index b6743077..d017b703 100644 --- a/push_notifications/migrations/0001_initial.py +++ b/push_notifications/migrations/0001_initial.py @@ -1,17 +1,14 @@ # -*- coding: utf-8 -*- -from django.conf import settings from django.db import migrations, models import push_notifications.fields +from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS), - ] +class Migration(migrations.Migration): - USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"] + USER_MODEL = SETTINGS["USER_MODEL"] operations = [ migrations.CreateModel( diff --git a/push_notifications/migrations/0003_wnsdevice.py b/push_notifications/migrations/0003_wnsdevice.py index 90671d89..a51f2b94 100644 --- a/push_notifications/migrations/0003_wnsdevice.py +++ b/push_notifications/migrations/0003_wnsdevice.py @@ -1,19 +1,17 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-13 20:46 import django.db.models.deletion -from django.conf import settings from django.db import migrations, models +from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS + class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS), ('push_notifications', '0002_auto_20160106_0850'), ] - USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"] - operations = [ migrations.CreateModel( name='WNSDevice', @@ -24,7 +22,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=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', diff --git a/push_notifications/migrations/0004_fcm.py b/push_notifications/migrations/0004_fcm.py index c5925d76..2c71adf7 100644 --- a/push_notifications/migrations/0004_fcm.py +++ b/push_notifications/migrations/0004_fcm.py @@ -1,13 +1,11 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-13 20:46 -from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS), ('push_notifications', '0003_wnsdevice'), ] diff --git a/push_notifications/migrations/0006_webpushdevice.py b/push_notifications/migrations/0006_webpushdevice.py index af752dd6..141d48bc 100644 --- a/push_notifications/migrations/0006_webpushdevice.py +++ b/push_notifications/migrations/0006_webpushdevice.py @@ -1,17 +1,15 @@ # -*- coding: utf-8 -*- -from django.conf import settings from django.db import migrations, models +from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS + class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.PUSH_NOTIFICATION_SETTINGS), ('push_notifications', '0005_applicationid'), ] - USER_MODEL = settings.PUSH_NOTIFICATION_SETTINGS["USER_MODEL"] - operations = [ migrations.CreateModel( name='WebPushDevice', @@ -25,7 +23,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=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',