-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
TreeRepository's findRoots query incorrectly when using a custom primary key #6948
Comments
ilyasfoo
changed the title
TreeRepository's findRoots query from property name instead of database column name
TreeRepository's findRoots query incorrectly when using a custom primary key
Oct 28, 2020
ilyasfoo
added a commit
to ilyasfoo/typeorm
that referenced
this issue
Oct 28, 2020
ilyasfoo
added a commit
to ilyasfoo/typeorm
that referenced
this issue
Oct 28, 2020
6 tasks
pleerock
pushed a commit
that referenced
this issue
Oct 30, 2020
dolsup
pushed a commit
to dolsup/typeorm
that referenced
this issue
Nov 3, 2020
* test: added failing test for github issue typeorm#6948 * fix: findRoots should get the actual primary key column, fixes typeorm#6948
zaro
pushed a commit
to zaro/typeorm
that referenced
this issue
Jan 12, 2021
* test: added failing test for github issue typeorm#6948 * fix: findRoots should get the actual primary key column, fixes typeorm#6948
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue type:
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[x]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Related to #2361
When we use a custom primary column, the query breaks because it seems
findRoots
makes an assumption that the primary key =id
.An example if we use
cat_id
as the primary key,findRoots
makes the following SQL query:Instead of the correct query:
The text was updated successfully, but these errors were encountered: