Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default issue(maybe) #617

Closed
wants to merge 1 commit into from
Closed

default issue(maybe) #617

wants to merge 1 commit into from

Conversation

pedia
Copy link

@pedia pedia commented Jun 13, 2023

According to the model with default bool, it's not desired. Is this a bug?

type Policy struct {
	gorm.Model
	Name      string
	BoolFalse bool `gorm:"default:false"`
	BoolTrue  bool `gorm:"default:true"`
}
policy2 := Policy{Name: "policy20", BoolFalse: true, BoolTrue: false}
result2 := DB.Create(&policy2)
assert.False(t, policy2.BoolTrue) // NOT RIGHT HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant