Replies: 1 comment 3 replies
-
Why are you expecting this to work? This is a wontfix to me, you need to call |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
After making a copy of the managed entity using
Utils.copy()
, the new entity instance is not managed. When changes made to the new instance are persisted, MikroOrm will produce an INSERT statement instead of an UPDATE statement and due to duplicate PK constraint this INSERT will fail.New copy/instance is not managed and this is probably the reason INSERT is generated.
Is there a way to "make" the copied instance as managed without triggering any additional SQL statement against the DB?
Reproduction
What driver are you using?
@mikro-orm/postgresql
MikroORM version
6.2.5
Node.js version
18.17.1
Operating system
MacOS 14.0
Validations
Beta Was this translation helpful? Give feedback.
All reactions