-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(core): Truncate db aliases if necessary #2959
fix(core): Truncate db aliases if necessary #2959
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
b661fe7
to
258afd1
Compare
Hi, Thanks for this contribution! Since this is quite a low-level modification, and heavily subject to the TypeORM internals, I'm wondering if there is some way we can add a test for this that:
Do you think this is something you can look into? |
258afd1
to
03f865d
Compare
Sorry for the long delay. I implemented a test case, inside the entity hydrator test suite. Without the fix the test will fail with:
|
Excellent work, thanks so much! |
Fixes #2899
Description
Postgres truncates long identifiers making them equal if they share the same prefix. For instance if two tables are being joined with a long alias (the names need to be a lot longer in reality)
product_variant_relation_0_relation_1
andproduct_variant_relation_0_relation_2
postgres will truncate both aliases toproduct_variant_rel
and fail because it's not allowed to have two join statements with the same target alias.Breaking changes
None
Checklist
📌 Always:
👍 Most of the time: