Default does not allow "null" #8572

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

Originally created by @DanSheps on GitHub (Sep 5, 2023).

NetBox version

v3.6.0

Python version

3.9

Steps to Reproduce

  1. Create a custom field set named Test ("test","Test"\n"tester","Tester"\n"testing","Testing")
  2. Create a custom field based off a selection list
    a. Name: Test
    b. Object: Circuits
    c. Type: Multiple Selection
    d. Required: False
    e. Default: null
    f. Choice Set: Test
  3. Save

Expected Behavior

Custom field saves

Observed Behavior

NotNullViolation: null value in column "default" of relation "extras_customfield" violates not-null constraint

Originally created by @DanSheps on GitHub (Sep 5, 2023). ### NetBox version v3.6.0 ### Python version 3.9 ### Steps to Reproduce 1. Create a custom field set named Test ("test","Test"\n"tester","Tester"\n"testing","Testing") 2. Create a custom field based off a selection list a. Name: Test b. Object: Circuits c. Type: Multiple Selection d. Required: False e. Default: null f. Choice Set: Test 3. Save ### Expected Behavior Custom field saves ### Observed Behavior NotNullViolation: null value in column "default" of relation "extras_customfield" violates not-null constraint
adam closed this issue 2025-12-29 20:38:19 +01:00
Author
Owner

@DanSheps commented on GitHub (Sep 5, 2023):

This may be a red-herring or something. Looks like a brand new test-db allows null values on custom fields. I am going to try and track this down.

@DanSheps commented on GitHub (Sep 5, 2023): This may be a red-herring or something. Looks like a brand new test-db allows null values on custom fields. I am going to try and track this down.
Author
Owner

@DanSheps commented on GitHub (Sep 5, 2023):

Looks like a migration wasn't properly applied on my prod instance, closing this out.

@DanSheps commented on GitHub (Sep 5, 2023): Looks like a migration wasn't properly applied on my prod instance, closing this out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8572