Просмотр исходного кода

Closes #10032: Remove unique constraint from L2VPN identifier

jeremystretch 3 лет назад
Родитель
Сommit
93b36ed580
3 измененных файлов с 7 добавлено и 7 удалено
  1. 1 1
      docs/models/ipam/l2vpn.md
  2. 1 3
      netbox/ipam/migrations/0059_l2vpn.py
  3. 5 3
      netbox/ipam/models/l2vpn.py

+ 1 - 1
docs/models/ipam/l2vpn.md

@@ -34,7 +34,7 @@ The technology employed in forming and operating the L2VPN. Choices include:
 
 ### Identifier
 
-An optional unique numeric identifier.
+An optional numeric identifier. This can be used to track a pseudowire ID, for example.
 
 ### Import & Export Targets
 

+ 1 - 3
netbox/ipam/migrations/0059_l2vpn.py

@@ -1,5 +1,3 @@
-# Generated by Django 4.0.5 on 2022-07-06 16:51
-
 import django.core.serializers.json
 from django.db import migrations, models
 import django.db.models.deletion
@@ -26,7 +24,7 @@ class Migration(migrations.Migration):
                 ('name', models.CharField(max_length=100, unique=True)),
                 ('slug', models.SlugField()),
                 ('type', models.CharField(max_length=50)),
-                ('identifier', models.BigIntegerField(blank=True, null=True, unique=True)),
+                ('identifier', models.BigIntegerField(blank=True, null=True)),
                 ('description', models.CharField(blank=True, max_length=200)),
                 ('export_targets', models.ManyToManyField(blank=True, related_name='exporting_l2vpns', to='ipam.routetarget')),
                 ('import_targets', models.ManyToManyField(blank=True, related_name='importing_l2vpns', to='ipam.routetarget')),

+ 5 - 3
netbox/ipam/models/l2vpn.py

@@ -15,11 +15,13 @@ class L2VPN(NetBoxModel):
         unique=True
     )
     slug = models.SlugField()
-    type = models.CharField(max_length=50, choices=L2VPNTypeChoices)
+    type = models.CharField(
+        max_length=50,
+        choices=L2VPNTypeChoices
+    )
     identifier = models.BigIntegerField(
         null=True,
-        blank=True,
-        unique=True
+        blank=True
     )
     import_targets = models.ManyToManyField(
         to='ipam.RouteTarget',