1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #1638: Migrate all primary keys to 64-bit integers

This commit is contained in:
Jeremy Stretch
2021-02-26 16:12:52 -05:00
parent cf78307577
commit 7e6cb9d186
17 changed files with 72 additions and 388 deletions

View File

@ -1,4 +1,5 @@
import django.core.serializers.json
# Generated by Django 3.2b1 on 2021-02-26 21:11
from django.db import migrations, models
@ -9,31 +10,6 @@ class Migration(migrations.Migration):
]
operations = [
migrations.AddField(
model_name='clustergroup',
name='custom_field_data',
field=models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder),
),
migrations.AddField(
model_name='clustertype',
name='custom_field_data',
field=models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder),
),
migrations.AddField(
model_name='vminterface',
name='created',
field=models.DateField(auto_now_add=True, null=True),
),
migrations.AddField(
model_name='vminterface',
name='custom_field_data',
field=models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder),
),
migrations.AddField(
model_name='vminterface',
name='last_updated',
field=models.DateTimeField(auto_now=True, null=True),
),
migrations.AlterField(
model_name='cluster',
name='id',

View File

@ -9,7 +9,7 @@ from dcim.models import BaseInterface, Device
from extras.models import ConfigContextModel, ObjectChange, TaggedItem
from extras.querysets import ConfigContextModelQuerySet
from extras.utils import extras_features
from netbox.models import OrganizationalModel, PrimaryModel
from netbox.models import BigIDModel, OrganizationalModel, PrimaryModel
from utilities.fields import NaturalOrderingField
from utilities.ordering import naturalize_interface
from utilities.query_functions import CollateAsChar
@ -374,7 +374,7 @@ class VirtualMachine(PrimaryModel, ConfigContextModel):
#
@extras_features('export_templates', 'webhooks')
class VMInterface(PrimaryModel, BaseInterface):
class VMInterface(BigIDModel, BaseInterface):
virtual_machine = models.ForeignKey(
to='virtualization.VirtualMachine',
on_delete=models.CASCADE,