docs(history-entry): document why we can't lazy-load

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-11-18 18:08:29 +01:00
parent 0c5fdf4201
commit 4d57105853
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -10,6 +10,13 @@ import { User } from '../users/user.entity';
@Entity()
export class HistoryEntry {
/**
* The `user` and `note` properties cannot be converted to promises
* (to lazy-load them), as TypeORM gets confused about lazy composite
* primary keys.
* See https://github.com/typeorm/typeorm/issues/6908
*/
@ManyToOne((_) => User, (user) => user.historyEntries, {
onDelete: 'CASCADE',
primary: true,