我想在postgres中添加一个类型为tsvector
的列,方法是在模型结构中定义一个字段。它看起来有点像:
type Issue struct {
...
TSV tsvector `json:"tsv"`
}
原因是我想使用gorm的AutoMigrate
来保持表格在开发时保持最新状态。有什么想法吗?
答案 0 :(得分:0)
type Address struct {
TSV string `gorm:"type:tsvector"`
}
同时参考https://github.com/jinzhu/gorm/blob/master/dialects/postgres/postgres.go,它应该与hstore,jsonb
类似