mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-03-16 21:30:24 +00:00
Adds a fallback for the first migrations with JSONField
This commit is contained in:
parent
21a0b95da8
commit
21c0a63ef5
2 changed files with 12 additions and 2 deletions
|
|
@ -1,6 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.db import migrations, models
|
||||
|
||||
try:
|
||||
from jsonfield.fields import JSONField
|
||||
except ImportError:
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
|
|
@ -11,7 +16,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name="notification",
|
||||
name="data",
|
||||
field=models.JSONField(null=True, blank=True),
|
||||
field=JSONField(null=True, blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ import django.utils.timezone
|
|||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
try:
|
||||
from jsonfield.fields import JSONField
|
||||
except ImportError:
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
|
|
@ -62,7 +67,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name="notification",
|
||||
name="data",
|
||||
field=models.JSONField(blank=True, null=True, verbose_name="data"),
|
||||
field=JSONField(blank=True, null=True, verbose_name="data"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="notification",
|
||||
|
|
|
|||
Loading…
Reference in a new issue