Repository navigation
fix: preserve user-defined shared join columns in change set - #12354
Conversation
In computeDiffColumns, the relational-column short-circuit now only applies to auto-created join columns whose propertyName matches the owning relation. User-defined columns that also serve as join columns keep their explicit entity value in the change set, preventing them from being silently omitted when the relation is set to a scalar plain id. Closes typeorm#12234
Code Review by Qodo
1. Regression test added in github-issues
|
commit: |
(cherry picked from commit ef34796)
Co-authored-by: Lucian Mocanu <[email protected]> (cherry picked from commit ef34796)
Summary
computeDiffColumns, the relational-column short-circuit now only applies to auto-created join columns (wherepropertyNamematches the owning relation'spropertyName).NOT NULL constraint failedor the value reverting silently.Fixes #12234
Test plan
test/github-issues/12234/with 3 regression tests:NOT NULL constraint failed: post.tenantId)pnpm run compile— passpnpm run typecheck— passprettier --checkon changed files — pass