From 4188b21685b5e9a1c3a1122a629933ce95a5b9ed Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 18 Sep 2022 19:49:53 +0200 Subject: [PATCH] docs: clarify comments for orphanedRowAction Co-authored-by: Yannick Bungers Signed-off-by: David Mehren --- src/history/history-entry.entity.ts | 4 ++-- src/permissions/note-group-permission.entity.ts | 4 ++-- src/permissions/note-user-permission.entity.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/history/history-entry.entity.ts b/src/history/history-entry.entity.ts index a2817e393..1bd1386b7 100644 --- a/src/history/history-entry.entity.ts +++ b/src/history/history-entry.entity.ts @@ -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; @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; diff --git a/src/permissions/note-group-permission.entity.ts b/src/permissions/note-group-permission.entity.ts index 08aef95a5..96cd6097a 100644 --- a/src/permissions/note-group-permission.entity.ts +++ b/src/permissions/note-group-permission.entity.ts @@ -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; @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; diff --git a/src/permissions/note-user-permission.entity.ts b/src/permissions/note-user-permission.entity.ts index 1dd206205..30a65515e 100644 --- a/src/permissions/note-user-permission.entity.ts +++ b/src/permissions/note-user-permission.entity.ts @@ -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; @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;