You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had a quick look at the model, is there any reason the number property of ASN (or BGPBase to be more precise) is nullable and not unique?
For now, I have added the unique=True constraint to the field, which seems to work, but this is a breaking change for existing databases:
There may already be multiple entries with same ASN
There may be entries with ASN set to None
Trying to set null=False breaks the migration:
You are trying to change the nullable field 'number' on asn to non-nullable without a default; we can't do that (the database needs something to populate existing rows).
Unfortunately, I am not as comfortable with Django and its migrations, is there a possibility to resolve this?
I think ASN shouldn't be unique. AS number is like a VLAN, you can use the same number for different purposes depending on device or site. Maybe it should use a combination of some fields to get unique.
do you have a specific use case? In my understanding ASNs are global should always be unique.
For VLANs I see the point in having one set of VLANs per site (although I noticed netbox lets you create indistinguishable VLANs as well).
In any case, null should not be allowed for AS numbers (or am I mistaken?)
When creating a new
duplicate entries will be created if there is already an object with the same properties.
The text was updated successfully, but these errors were encountered: