-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue 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