Skip to content

decimal在 automigrate的时候无法正确同步 #7449

@Chise1

Description

@Chise1

GORM Playground Link

go-gorm/playground#801

Description

当我使用自动同步的时候,我的decimal字段,无法正确识别精度,每次都会因为精度问题自动执行修改。

模型

type Change struct {
	RecID int64 `gorm:"column:recid;type:decimal(9,0);not null;autoIncrement:false" json:"recid"`
}


每次都会执行:

 ALTER TABLE `changes` MODIFY COLUMN `recid` decimal(9,0) NOT NULL        

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions