docs: clarify comments for orphanedRowAction

Co-authored-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-09-18 19:49:53 +02:00
parent a626ace4b9
commit 4188b21685
3 changed files with 6 additions and 6 deletions

View file

@ -23,13 +23,13 @@ export class HistoryEntry {
@ManyToOne((_) => User, (user) => user.historyEntries, {
onDelete: 'CASCADE',
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Entry stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the history entry is deleted when no user references it anymore
})
user: Promise<User>;
@ManyToOne((_) => Note, (note) => note.historyEntries, {
onDelete: 'CASCADE',
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Entry stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the history entry is deleted when no note references it anymore
})
note: Promise<Note>;

View file

@ -22,13 +22,13 @@ export class NoteGroupPermission {
@ManyToOne((_) => Group, {
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Group is deleted
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Permission stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the NoteGroupPermission is deleted when no group references it anymore
})
group: Promise<Group>;
@ManyToOne((_) => Note, (note) => note.groupPermissions, {
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Note is deleted
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Permission stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the NoteGroupPermission is deleted when no note references it anymore
})
note: Promise<Note>;

View file

@ -22,13 +22,13 @@ export class NoteUserPermission {
@ManyToOne((_) => User, {
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Permission stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the NoteUserPermission is deleted when no user references it anymore
})
user: Promise<User>;
@ManyToOne((_) => Note, (note) => note.userPermissions, {
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
orphanedRowAction: 'delete', // This ensures the whole row is deleted when the Permission stops being referenced
orphanedRowAction: 'delete', // This ensures the row of the NoteUserPermission is deleted when no note references it anymore
})
note: Promise<Note>;