Increase Tenant and Tenant Group name field lengths #8391

Closed
opened 2025-12-29 20:36:07 +01:00 by adam · 2 comments
Owner

Originally created by @hagbarddenstore on GitHub (Jul 31, 2023).

NetBox version

v3.5.7

Feature type

Change to existing functionality

Proposed functionality

Increase the length of the name field on Tenant and Tenant Group models.

Use case

We provide services to municipalities in Sweden and some of these buy shared resources together, example, Municipality A, Municipality B and Municipality C buy a single resource which they share. Our Tenant name ends up being "Municipality A, Municipality B and Municipality C".

Sometimes a shorter name exists and thus solves the issue, but many times such a name doesn't exist and we end up with truncated names.

Database changes

Increase max_length on name field on models Tenant and Tenant Group.

External dependencies

None

Originally created by @hagbarddenstore on GitHub (Jul 31, 2023). ### NetBox version v3.5.7 ### Feature type Change to existing functionality ### Proposed functionality Increase the length of the `name` field on `Tenant` and `Tenant Group` models. ### Use case We provide services to municipalities in Sweden and some of these buy shared resources together, example, Municipality A, Municipality B and Municipality C buy a single resource which they share. Our Tenant name ends up being "Municipality A, Municipality B and Municipality C". Sometimes a shorter name exists and thus solves the issue, but many times such a name doesn't exist and we end up with truncated names. ### Database changes Increase `max_length` on `name` field on models `Tenant` and `Tenant Group`. ### External dependencies None
adam added the type: feature label 2025-12-29 20:36:07 +01:00
adam closed this issue 2025-12-29 20:36:07 +01:00
Author
Owner

@hagbarddenstore commented on GitHub (Jul 31, 2023):

I can implement the change if accepted.

@hagbarddenstore commented on GitHub (Jul 31, 2023): I can implement the change if accepted.
Author
Owner

@jeremystretch commented on GitHub (Aug 1, 2023):

Our Tenant name ends up being "Municipality A, Municipality B and Municipality C".

This is a textbook example of misusing a relational model, and a great example of why the field length limits exist. You're attempting to use an object intended to represent a single entity to represent multiple entities, rather than creating a discrete object for each. A single text field will never be long enough to fit this model. (What if you needed to assign a dozen municipalities? A hundred?)

Tenants in NetBox are meant to represent ownership of rather than dependency on individual resources, which is why only one tenant may be assigned per object. Your use case would be better served by a multi-object custom field, or even a custom plugin to track dependencies among objects.

@jeremystretch commented on GitHub (Aug 1, 2023): > Our Tenant name ends up being "Municipality A, Municipality B and Municipality C". This is a textbook example of misusing a relational model, and a great example of why the field length limits exist. You're attempting to use an object intended to represent a _single_ entity to represent multiple entities, rather than creating a discrete object for each. A single text field will _never_ be long enough to fit this model. (What if you needed to assign a dozen municipalities? A hundred?) Tenants in NetBox are meant to represent ownership of rather than dependency on individual resources, which is why only one tenant may be assigned per object. Your use case would be better served by a multi-object custom field, or even a custom plugin to track dependencies among objects.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8391