mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
docs(permissions): document why we can't lazy-load
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
d7aaf736a2
commit
7f7886c5a7
2 changed files with 14 additions and 0 deletions
|
@ -10,6 +10,13 @@ import { Note } from '../notes/note.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class NoteGroupPermission {
|
export class NoteGroupPermission {
|
||||||
|
/**
|
||||||
|
* The `group` 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((_) => Group, {
|
@ManyToOne((_) => Group, {
|
||||||
primary: true,
|
primary: true,
|
||||||
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Group is deleted
|
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Group is deleted
|
||||||
|
|
|
@ -10,6 +10,13 @@ import { User } from '../users/user.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class NoteUserPermission {
|
export class NoteUserPermission {
|
||||||
|
/**
|
||||||
|
* 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, {
|
@ManyToOne((_) => User, {
|
||||||
primary: true,
|
primary: true,
|
||||||
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
|
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue