-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
MissingPrimaryColumnError when primary defined in relation #43
Comments
this is not supported yet. But it should be in the future version. Right now its a bit complicated, because orm doesn't analize insertion/updating order (which is complicated) and first inserts object with entity with NULL in relationId, then updates its relationId after it saves related entity. With relation's column primary key it won't work because primary key cannot be NULL. So, to fix this issue it needs deep refactoring, and I'll plan it to the future versions |
Ok, it's not a big deal for now - I created But is there an option to have a pair of relation fields defined as an unique constraint? |
maybe using indices can help? |
Yes, thanks! It works great now 😄 Sorry for asking this kind of question but the docs is empty and website documentation was updated today and I haven't checked it yet 😉 |
Excuse me, How indices can help with this error? (Your link is no longer valid) |
I have an entity described that:
And I have an error on launch:
Error! { MissingPrimaryColumnError: Entity "Result" does not have a primary column. Primary column is required to have in all your entities. Use @PrimaryColumn decorator to add a primary column to your entity.
Does the
primary
in relations option doesn't work yet or it's just a bug in checking if primary is defined?The text was updated successfully, but these errors were encountered: