Closed
Description
GORM Playground Link
Description
My previous struct is :
type Rule struct {
PType string `gorm:"size:40;uniqueIndex:unique_index"`
V0 string `gorm:"size:40;uniqueIndex:unique_index"`
V1 string `gorm:"size:40;uniqueIndex:unique_index"`
}
Now, I add primary key for this table like this:
type Rule struct {
ID uint
PType string `gorm:"size:40;uniqueIndex:unique_index"`
V0 string `gorm:"size:40;uniqueIndex:unique_index"`
V1 string `gorm:"size:40;uniqueIndex:unique_index"`
}
I get a error
Error 1075: Incorrect table definition; there can be only one auto column and it must be defined as a key
But my table doesn't have auto column
Maybe it was error of Mysql?