You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a reference to a foreign entity exists together with a foreign key in the entity, TypeORM fails to update the entity with multiple assignments to same column error. This is also discussed in issue #2651. Please see the example in Actual Behavior
Expected Behavior
It is able to update getting the entity in the DB by passing only one id.
Actual Behavior
It is adding update expression for both the id in the reference and FK in the entity itself. This leads multiple assignments to same column error for Postgresql.
QueryFailedError: multiple assignments to same column "user_id"
at QueryFailedError.TypeORMError [as constructor] (src/error/TypeORMError.ts:7:9)
at new QueryFailedError (src/error/QueryFailedError.ts:9:9)
at PostgresQueryRunner.<anonymous> (src/driver/postgres/PostgresQueryRunner.ts:263:19)
at step (node_modules/tslib/tslib.js:143:27)
at Object.throw (node_modules/tslib/tslib.js:124:57)
at rejected (node_modules/tslib/tslib.js:115:69)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Issue Description
When a reference to a foreign entity exists together with a foreign key in the entity, TypeORM fails to update the entity with
multiple assignments to same column
error. This is also discussed in issue #2651. Please see the example in Actual BehaviorExpected Behavior
It is able to update getting the entity in the DB by passing only one id.
Actual Behavior
It is adding update expression for both the id in the reference and FK in the entity itself. This leads
multiple assignments to same column
error for Postgresql.Steps to Reproduce
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: