diff --git a/netbox/circuits/models.py b/netbox/circuits/models.py index 4fc64d590..b57332528 100644 --- a/netbox/circuits/models.py +++ b/netbox/circuits/models.py @@ -175,7 +175,8 @@ class Circuit(ChangeLoggedModel, CustomFieldModel): ordering = ['provider', 'cid'] constraints = [ models.UniqueConstraint( - fields=['provider', 'cid'], name='circuit_provider_cid_key' + fields=['provider', 'cid'], + name='circuits_circuit_provider_cid_key' ) ] @@ -272,7 +273,7 @@ class CircuitTermination(CableTermination): constraints = [ models.UniqueConstraint( fields=['circuit', 'term_side'], - name='circuittermination_circuit_termside_key' + name='circuits_circuittermination_circuit_term_side_key' ) ] diff --git a/netbox/dcim/models.py b/netbox/dcim/models.py index 4f08e806d..b27436a35 100644 --- a/netbox/dcim/models.py +++ b/netbox/dcim/models.py @@ -391,11 +391,11 @@ class RackGroup(ChangeLoggedModel): constraints = [ models.UniqueConstraint( fields=['site', 'name'], - name='rackgroup_site_name_key' + name='dcim_rackgroup_site_name_key' ), models.UniqueConstraint( fields=['site', 'slug'], - name='rackgroup_site_slug_key' + name='dcim_rackgroup_site_slug_key' ) ] @@ -562,11 +562,11 @@ class Rack(ChangeLoggedModel, CustomFieldModel): constraints = [ models.UniqueConstraint( fields=['group', 'name'], - name='rack_group_name_key' + name='dcim_rack_group_name_key' ), models.UniqueConstraint( fields=['group', 'facility_id'], - name='rack_group_facility_key' + name='dcim_rack_group_facility_key' ) ] @@ -934,11 +934,11 @@ class DeviceType(ChangeLoggedModel, CustomFieldModel): constraints = [ models.UniqueConstraint( fields=['manufacturer', 'model'], - name='devicetype_manufacturer_model_key' + name='dcim_devicetype_manufacturer_model_key' ), models.UniqueConstraint( fields=['manufacturer', 'slug'], - name='devicetype_manufacturer_slug_key' + name='dcim_devicetype_manufacturer_slug_key' ) ] @@ -1027,7 +1027,7 @@ class ConsolePortTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='consoleporttemplate_devicetype_name_key' + name='dcim_consoleporttemplate_device_type_name_key' ) ] @@ -1055,7 +1055,7 @@ class ConsoleServerPortTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='consoleserverporttemplate_devicetype_name_key' + name='dcim_consoleserverporttemplate_device_type_name_key' ) ] @@ -1095,7 +1095,7 @@ class PowerPortTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='powerporttemplate_devicetype_name_key' + name='dcim_powerporttemplate_device_type_name_key' ) ] @@ -1136,7 +1136,7 @@ class PowerOutletTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='poweroutlettemplate_devicetype_name_key' + name='dcim_poweroutlettemplate_device_type_name_key' ) ] @@ -1180,7 +1180,7 @@ class InterfaceTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='interfacetemplate_devicetype_name_key' + name='dcim_interfacetemplate_device_type_name_key' ) ] @@ -1236,11 +1236,11 @@ class FrontPortTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='frontporttemplate_devicetype_name_key' + name='dcim_frontporttemplate_device_type_name_key' ), models.UniqueConstraint( fields=['rear_port', 'rear_port_position'], - name='frontporttemplate_rearport_rearportposition_key' + name='dcim_frontporttemplate_rear_port_rear_port_position_key' ) ] @@ -1291,7 +1291,7 @@ class RearPortTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='rearporttemplate_devicetype_name_key' + name='dcim_rearporttemplate_device_type_name_key' ) ] @@ -1319,7 +1319,7 @@ class DeviceBayTemplate(ComponentTemplateModel): constraints = [ models.UniqueConstraint( fields=['device_type', 'name'], - name='devicebaytemplate_devicetype_name_key' + name='dcim_devicebaytemplate_device_type_name_key' ) ] @@ -1573,11 +1573,11 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel): constraints = [ models.UniqueConstraint( fields=['rack', 'position', 'face'], - name='device_rack_position_face_key' + name='dcim_device_rack_position_face_key' ), models.UniqueConstraint( fields=['virtual_chassis', 'vc_position'], - name='device_virtualchassis_vcposition_key' + name='dcim_device_virtual_chassis_vc_position_key' ), ] permissions = ( @@ -1879,7 +1879,7 @@ class ConsolePort(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='consoleport_device_name_key' + name='dcim_consoleport_device_name_key' ) ] @@ -1927,7 +1927,7 @@ class ConsoleServerPort(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='consoleserverport_device_name_key' + name='dcim_consoleserverport_device_name_key' ) ] @@ -2002,7 +2002,7 @@ class PowerPort(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='powerport_device_name_key' + name='dcim_powerport_device_name_key' ) ] @@ -2130,7 +2130,7 @@ class PowerOutlet(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='poweroutlet_device_name_key' + name='dcim_poweroutlet_device_name_key' ) ] @@ -2266,7 +2266,7 @@ class Interface(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='interface_device_name_key' + name='dcim_interface_device_name_key' ) ] @@ -2481,11 +2481,11 @@ class FrontPort(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='frontport_device_name_key' + name='dcim_frontport_device_name_key' ), models.UniqueConstraint( fields=['rear_port', 'rear_port_position'], - name='frontport_rearport_rearportposition_key' + name='dcim_frontport_rear_port_rear_port_position_key' ) ] @@ -2549,7 +2549,7 @@ class RearPort(CableTermination, ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='rearport_device_name_key' + name='dcim_rearport_device_name_key' ) ] @@ -2601,7 +2601,7 @@ class DeviceBay(ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'name'], - name='devicebay_device_name_key', + name='dcim_devicebay_device_name_key', ) ] @@ -2698,7 +2698,7 @@ class InventoryItem(ComponentModel): constraints = [ models.UniqueConstraint( fields=['device', 'parent', 'name'], - name='inventoryitem_device_parent_name_key' + name='dcim_inventoryitem_device_parent_name_key' ) ] @@ -2842,11 +2842,11 @@ class Cable(ChangeLoggedModel): constraints = [ models.UniqueConstraint( fields=['termination_a_type', 'termination_a_id'], - name='cable_terminationatype_terminationaid_key' + name='dcim_cable_termination_a_type_termination_a_id_key' ), models.UniqueConstraint( fields=['termination_b_type', 'termination_b_id'], - name='cable_terminationbtype_terminationbid_key' + name='dcim_cable_termination_b_type_termination_b_id_key' ) ] diff --git a/netbox/extras/models.py b/netbox/extras/models.py index 4dc46bba1..c8860cb9f 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -93,7 +93,7 @@ class Webhook(models.Model): fields=[ 'payload_url', 'type_create', 'type_update', 'type_delete' ], - name='webhook_webhooktype_payload_key' + name='extras_webhook_payload_url_type_create_type_update_type_delete_key' ) ] @@ -269,7 +269,7 @@ class CustomFieldValue(models.Model): constraints = [ models.UniqueConstraint( fields=['field', 'obj_type', 'obj_id'], - name='customfieldvalue_field_objtype_objid_key' + name='extras_customfieldvalue_field_obj_type_obj_id_key' ) ] @@ -312,7 +312,7 @@ class CustomFieldChoice(models.Model): constraints = [ models.UniqueConstraint( fields=['field', 'value'], - name='customfieldchoice_field_value_key' + name='extras_customfieldchoice_field_value_key' ) ] @@ -467,7 +467,7 @@ class ExportTemplate(models.Model): constraints = [ models.UniqueConstraint( fields=['content_type', 'name'], - name='exporttemplate_name_contenttype_key' + name='extras_exporttemplate_content_type_name_key' ) ] diff --git a/netbox/ipam/models.py b/netbox/ipam/models.py index 10d8a47f0..c918e07c5 100644 --- a/netbox/ipam/models.py +++ b/netbox/ipam/models.py @@ -743,11 +743,11 @@ class VLANGroup(ChangeLoggedModel): constraints = [ models.UniqueConstraint( fields=['site', 'name'], - name='vlangroup_site_name_key' + name='ipam_vlangroup_site_name_key' ), models.UniqueConstraint( fields=['site', 'slug'], - name='vlangroup_site_slug_key' + name='ipam_vlangroup_site_slug_key' ) ] verbose_name = 'VLAN group' @@ -845,11 +845,11 @@ class VLAN(ChangeLoggedModel, CustomFieldModel): constraints = [ models.UniqueConstraint( fields=['group', 'vid'], - name='vlan_group_vid_key' + name='ipam_vlan_group_vid_key' ), models.UniqueConstraint( fields=['group', 'name'], - name='vlan_group_name_key' + name='ipam_vlan_group_name_key' ) ] verbose_name = 'VLAN' diff --git a/netbox/secrets/models.py b/netbox/secrets/models.py index 73e50efee..50d7cd720 100644 --- a/netbox/secrets/models.py +++ b/netbox/secrets/models.py @@ -355,7 +355,7 @@ class Secret(ChangeLoggedModel, CustomFieldModel): constraints = [ models.UniqueConstraint( fields=['device', 'role', 'name'], - name='secret_device_role_name_key' + name='secrets_secret_device_role_name_key' ) ]