gorm2sql
gorm2sql copied to clipboard
存在表关联关系的字段没法生成,怎么样对一个源文件中多个struct生成到一个sql文件
type User struct {
Id int
Name string
Profile *Profile orm:"rel(one)" // OneToOne relation
Post []*Post orm:"reverse(many)" // 设置一对多反向关系
}
type Profile struct {
Id int
Age int16
User *User orm:"reverse(one)" // 设置一对一反向关系(可选)
}
报错内容:sql.go sqlorm.(*SqlGenerator).getStructFieds:132 ▶ filed Profile not supported, ignore sql.go sqlorm.(*SqlGenerator).getStructFieds:132 ▶ filed Post not supported, ignore