gorm2sql icon indicating copy to clipboard operation
gorm2sql copied to clipboard

存在表关联关系的字段没法生成,怎么样对一个源文件中多个struct生成到一个sql文件

Open nola222 opened this issue 6 years ago • 0 comments

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

nola222 avatar Apr 16 '19 10:04 nola222