mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Change Postgres-specific JSONField to stock Django field
This commit is contained in:
28
netbox/extras/migrations/0046_update_jsonfield.py
Normal file
28
netbox/extras/migrations/0046_update_jsonfield.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 3.1b1 on 2020-07-16 16:01
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0045_configcontext_changelog'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='configcontext',
|
||||
name='data',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='jobresult',
|
||||
name='data',
|
||||
field=models.JSONField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='objectchange',
|
||||
name='object_data',
|
||||
field=models.JSONField(editable=False),
|
||||
),
|
||||
]
|
@@ -1,7 +1,6 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
||||
@@ -104,7 +103,7 @@ class ObjectChange(models.Model):
|
||||
max_length=200,
|
||||
editable=False
|
||||
)
|
||||
object_data = JSONField(
|
||||
object_data = models.JSONField(
|
||||
editable=False
|
||||
)
|
||||
|
||||
|
@@ -5,7 +5,6 @@ from collections import OrderedDict
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.core.validators import ValidationError
|
||||
from django.db import models
|
||||
from django.http import HttpResponse
|
||||
@@ -499,7 +498,7 @@ class ConfigContext(ChangeLoggedModel):
|
||||
related_name='+',
|
||||
blank=True
|
||||
)
|
||||
data = JSONField()
|
||||
data = models.JSONField()
|
||||
|
||||
objects = ConfigContextQuerySet.as_manager()
|
||||
|
||||
@@ -526,7 +525,7 @@ class ConfigContextModel(models.Model):
|
||||
A model which includes local configuration context data. This local data will override any inherited data from
|
||||
ConfigContexts.
|
||||
"""
|
||||
local_context_data = JSONField(
|
||||
local_context_data = models.JSONField(
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
@@ -627,7 +626,7 @@ class JobResult(models.Model):
|
||||
choices=JobResultStatusChoices,
|
||||
default=JobResultStatusChoices.STATUS_PENDING
|
||||
)
|
||||
data = JSONField(
|
||||
data = models.JSONField(
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
|
Reference in New Issue
Block a user