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

entc/gen: support type-based matching for edge-schema columns #3306

Merged
merged 1 commit into from Feb 7, 2023

Conversation

a8m
Copy link
Member

@a8m a8m commented Feb 7, 2023

In case of no match by foreign-keys, we search by edge-type. This can happen if the type (edge owner) is named T, but the edge-schema E names its edge field as u_id. We consider it as a match if there is only one usage of T in E.

In case of no match by foreign-keys, we search by edge-type. This can happen if the type (edge owner)
is named T, but the edge-schema E names its edge field as u_id. We consider it as a match if
there is only one usage of T in E.
@a8m a8m merged commit baec350 into master Feb 7, 2023
@a8m a8m deleted the matchedges branch February 7, 2023 08:58
@NickDubelman
Copy link

Hmm just want to make sure but this looks like it was a response to the repro I created and posted in Discord ~2 weeks ago or so?

https://github.com/NickDubelman/ent/tree/edge-schema-repro

I'm going to try and pull master and see if it resolves my issue!

@NickDubelman
Copy link

Seems to fix it! Thanks a lot for the quick fix, your solution is better than what I expected because it doesn't require any explicit StorageKey

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

Successfully merging this pull request may close these issues.

None yet

2 participants