0
我想在postgres中添加一个类型为tsvector
的列,方法是在模型结构中定义一个字段。它看起来有点像:定义模型的tsvector类型列
type Issue struct {
...
TSV tsvector `json:"tsv"`
}
的原因是,我想用GORM的AutoMigrate
保持表上的最新发展时。有任何想法吗?
我想在postgres中添加一个类型为tsvector
的列,方法是在模型结构中定义一个字段。它看起来有点像:定义模型的tsvector类型列
type Issue struct {
...
TSV tsvector `json:"tsv"`
}
的原因是,我想用GORM的AutoMigrate
保持表上的最新发展时。有任何想法吗?
type Address struct {
TSV string `gorm:"type:tsvector"`
}
另请参阅https://github.com/jinzhu/gorm/blob/master/dialects/postgres/postgres.go,它应该就像hstore相似,jsonb
感谢。我提出了一个编辑,使答案与问题的特定性更相关。 –