Skip to content

Boolean fields cant be set to false if they have a default tag which is set to true #7556

@Fuzzyma

Description

@Fuzzyma

GORM Playground Link

go-gorm/playground#824

Description

This is a duplicate of #7543 which the github bot keeps marking as stale.

The title says it all. So something like this will not work:

type Tree struct {
	ID        uint    `json:"id" gorm:"primaryKey"`
	IsAlive   bool    `json:"is_alive" gorm:"default:true"`
	Height    float64 `json:"height" gorm:"type:FLOAT"`
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions