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

Allow modification of null values #7064

Open
enzofoucaud opened this issue Jun 12, 2024 · 0 comments
Open

Allow modification of null values #7064

enzofoucaud opened this issue Jun 12, 2024 · 0 comments
Assignees
Labels
type:feature_request feature request

Comments

@enzofoucaud
Copy link

enzofoucaud commented Jun 12, 2024

Describe the feature

Allow me to updates non zero value

Motivation

map[string]interface{} is complicated to use when you have complex structures like :

type Component struct {
	gorm.Model
	FamilyID               uint
	Name                   string
        ...

	// Relationships
	1 []1 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
	2 []2 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
	3 []3 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
	4 []4 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
	5 []5 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
        ...

	// Relationships others
	10 []10 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
	11 []11 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
}

Related Issues

#3901

Description

maybe add :

  • gorm:"allowzero"

maybe fix :

  • Select(*) before Update or Updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature_request feature request
Projects
None yet
Development

No branches or pull requests

2 participants