Extend the default "created" field on models from DateField to DateTimeField #6006

Closed
opened 2025-12-29 19:35:38 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 26, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.6

Feature type

Change to existing functionality

Proposed functionality

All change-logged models in NetBox have two common fields:

created = models.DateField(auto_now_add=True)
last_updated = models.DateTimeField(auto_now=True)

This issue proposes migrating the created field to a DateTimeField to match last_updated. (In doing so, existing date values will receive a 00:00:00 timestamp.)

Use case

Provides greater granularity concerning the time at which an object in NetBox is created.

Database changes

Simple migration of the created field on all relevant models.

External dependencies

No response

Originally created by @jeremystretch on GitHub (Jan 26, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.6 ### Feature type Change to existing functionality ### Proposed functionality All change-logged models in NetBox have two common fields: ``` created = models.DateField(auto_now_add=True) last_updated = models.DateTimeField(auto_now=True) ``` This issue proposes migrating the `created` field to a DateTimeField to match `last_updated`. (In doing so, existing date values will receive a 00:00:00 timestamp.) ### Use case Provides greater granularity concerning the time at which an object in NetBox is created. ### Database changes Simple migration of the `created` field on all relevant models. ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:35:38 +01:00
adam closed this issue 2025-12-29 19:35:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6006