Issue with snake_case naming strategy
See original GitHub issueIssue type:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[x] mssql
[x] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
I have two tables:
product
id
product_attachment
id product_id
var productAttachment = repository.findAndCount({ relations: 'product'});
QueryFailedError: ER_DUP_FIELDNAME: Duplicate column name ‘ProductAttachment_product_id’
This issue happens because query builder generate alias ProductAttachment_product_id twice: product_attachment.product_id -> ProductAttachment_product_id product_attachment.product.id -> ProductAttachment_product_id
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:22 (4 by maintainers)
Top GitHub Comments
Can confirm that setting the snake-case naming strategy fixes the issue!
how could this not been fixed yet? 😦