Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #269

Open
floating-yuan opened this issue Mar 27, 2024 · 0 comments

Comments

@floating-yuan
Copy link

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 floating-yuan changed the title panic: Object maORM from package common cannot be user for has-one in mbORM since it does not have FK field aId defined. Manually define the key, or switch to belongs-to. panic: Object maORM from package common 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. Mar 27, 2024
@floating-yuan floating-yuan changed the title panic: Object maORM from package common 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. 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. Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant