Skip to content

Commit

Permalink
fix: findRoots should get the actual primary key column, fixes typeor…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasfoo committed Oct 28, 2020
1 parent b8b5e9b commit 51b4aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/repository/TreeRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TreeRepository<Entity> extends Repository<Entity> {
const escapeAlias = (alias: string) => this.manager.connection.driver.escape(alias);
const escapeColumn = (column: string) => this.manager.connection.driver.escape(column);
const parentPropertyName = this.manager.connection.namingStrategy.joinColumnName(
this.metadata.treeParentRelation!.propertyName, "id"
this.metadata.treeParentRelation!.propertyName, this.metadata.primaryColumns[0].propertyName
);

return this.createQueryBuilder("treeEntity")
Expand Down

0 comments on commit 51b4aa0

Please sign in to comment.