-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Can't map primary key that is a foreign key to a composite key. #1624
Comments
From what I see in your code you are missing the following property.
https://mikro-orm.io/docs/composite-keys/#use-case-1-dynamic-attributes |
@Langstra I'll add it back in but it doesn't fix the issue. |
The code is ok, Already got it reproduced, there are basically two problems, one with the |
@B4nan thanks for fixing this so quickly! |
Things like this have indeed priority! :] You can try the fix via dev version btw ( |
Thanks I was trying to figure out how to pull it in because I was dead in the water. Looks like it works for me! |
Describe the bug
I am using postgresql partitioned tables so most of my primary keys are composite keys. When I create a table with a foreign key to a composite primary key it fails to map.
Stack trace
To Reproduce
I created a minimal reproducible example here: https://github.com/erik-induro/mikro-orm-fk
Here are some examples that fail:
Expected behavior
I expect the data to map.
Additional context
If the FK is not the PK then it works fine.
Versions
The text was updated successfully, but these errors were encountered: