Open maja42 opened 1 year ago
Temporary workaround for go.mod:
exclude gorm.io/gorm v1.24.4
exclude gorm.io/gorm v1.24.5
exclude gorm.io/driver/postgres v1.4.6
exclude gorm.io/driver/postgres v1.4.7
Maybe this is (also) a bug in gorm.io/gorm?
Updated exclude list:
exclude (
gorm.io/driver/postgres v1.4.6
gorm.io/driver/postgres v1.4.7
gorm.io/driver/postgres v1.4.8
gorm.io/driver/postgres v1.5.0
gorm.io/driver/postgres v1.5.1
gorm.io/driver/postgres v1.5.2
gorm.io/driver/postgres v1.5.3
gorm.io/gorm v1.24.4
gorm.io/gorm v1.24.5
gorm.io/gorm v1.24.6
gorm.io/gorm v1.25.0
gorm.io/gorm v1.25.1
gorm.io/gorm v1.25.2
)
The list is getting longer:
exclude (
gorm.io/driver/postgres v1.4.6
gorm.io/driver/postgres v1.4.7
gorm.io/driver/postgres v1.4.8
gorm.io/driver/postgres v1.5.0
gorm.io/driver/postgres v1.5.1
gorm.io/driver/postgres v1.5.2
gorm.io/driver/postgres v1.5.3
gorm.io/driver/postgres v1.5.4
gorm.io/gorm v1.24.4
gorm.io/gorm v1.24.5
gorm.io/gorm v1.24.6
gorm.io/gorm v1.25.0
gorm.io/gorm v1.25.1
gorm.io/gorm v1.25.2
gorm.io/gorm v1.25.3
gorm.io/gorm v1.25.4
gorm.io/gorm v1.25.5
)
This is a follow-up to #152, because the proposed "solution" / workaround doesn't work. The ticket was already closed though.
In PostgreSQL, the column has type JSONB.
go (simplified):
I'm already using datatypes.JSON in my custom serializer / scanner, as proposed by the other ticket. However, they are never called for nil-slices.
Before 1.4.6, my serializers converted nil-slices to empty json-arrays. Now, they are ignored, nil gets converted into a PostgreSQL null, and my not-null-constraints are triggered. So this is definitely a breaking change.