protoc-gen-gorm icon indicating copy to clipboard operation
protoc-gen-gorm copied to clipboard

panic: Object maORM from package a cannot be user for has-one in mbORM since it does not have FK field maId defined. Manually define the key, or switch to belongs-to.

Open floating-yuan opened this issue 11 months ago • 0 comments

this error occurred when b.proto has import a.proto.

/model/a/a.proto

package model.a
message ma{
}

/model/b/b.proto

package model.b
import "model/a/a.proto"
message mb{
  api.a.ma a = 1;
}

if I move message ma into b.proto /model/b/b.proto

package model.b

message ma{
}

message mb{
  ma a = 1;
}

that will be ok. does protoc-gen-gorm support for import the message from other package?

floating-yuan avatar Mar 27 '24 03:03 floating-yuan