![3CFBE17B-5142-4B07-A12C-94F1DF9B0596.png](
https://i.loli.net/2019/02/20/5c6ce3a73460d.png)
```
// 重设列名
type Animal struct {
AnimalId int64 `gorm:"column:beast_id"` // 设置列名为`beast_id`
Birthday time.Time `gorm:"column:day_of_the_beast"` // 设置列名为`day_of_the_beast`
Age int64 `gorm:"column:age_of_the_beast"` // 设置列名为`age_of_the_beast`
}
```
``` golang
// 使用 tag`primary_key`用来设置主键
type Animal struct {
AnimalId int64 `gorm:"primary_key"` // 设置 AnimalId 为主键
Name string
Age int64
}
```
比如我想把 IDs 作为 pk,这里如何写呢