Drop the family column from IP objects #3267

Closed
opened 2025-12-29 18:27:15 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 3, 2020).

Proposed Changes

Drop the family column from the table for each IP object (aggregated, prefixes, and IP addresses). This column indicates the address family (IP version): 4 or 6.

Justification

  1. There is no need to explicitly store this data in the table, as it is implied by the address itself.
  2. Removing it obviates the need for manual population when creating objects via bulk_create() for testing purposes.

Although the column will be removed, we should maintain the family fields in the relevant API serializers. Not only for backward-compatability, but because there is some value in explicitly stating the IP family. (These have been and will remain read-only fields.)

We'll also preserve the family query filter by leveraging PostgreSQL's family() function.

Originally created by @jeremystretch on GitHub (Feb 3, 2020). ### Proposed Changes Drop the `family` column from the table for each IP object (aggregated, prefixes, and IP addresses). This column indicates the address family (IP version): `4` or `6`. ### Justification 1. There is no need to explicitly store this data in the table, as it is implied by the address itself. 2. Removing it obviates the need for manual population when creating objects via `bulk_create()` for testing purposes. Although the column will be removed, we should maintain the `family` fields in the relevant API serializers. Not only for backward-compatability, but because there is some value in explicitly stating the IP family. (These have been and will remain read-only fields.) We'll also preserve the `family` query filter by leveraging PostgreSQL's [`family()` function](https://www.postgresql.org/docs/9.6/functions-net.html).
adam added the status: acceptedtype: housekeeping labels 2025-12-29 18:27:15 +01:00
adam closed this issue 2025-12-29 18:27:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3267