1. 复合主键

可以设置多个字段为主键来开启复合主键功能:

type Product struct {
    ID           string `gorm:"primary_key"`
    LanguageCode string `gorm:"primary_key"`
  Code         string
  Name         string
}

results matching ""

    No results matching ""