mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
Entities: Add onDelete CASCADE to entities
To better handle deletion of entities, all necessary other entities got the option onDelete CASCADE set. So everything that does not make any sense if something else is deleted will be deleted along side of it. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
5758463b07
commit
24ee95282d
6 changed files with 22 additions and 6 deletions
|
@ -17,6 +17,7 @@ import { AuthToken } from '../auth/auth-token.entity';
|
|||
import { Identity } from './identity.entity';
|
||||
import { Group } from '../groups/group.entity';
|
||||
import { HistoryEntry } from '../history/history-entry.entity';
|
||||
import { MediaUpload } from '../media/media-upload.entity';
|
||||
|
||||
@Entity()
|
||||
export class User {
|
||||
|
@ -62,6 +63,9 @@ export class User {
|
|||
@OneToMany((_) => HistoryEntry, (historyEntry) => historyEntry.user)
|
||||
historyEntries: HistoryEntry[];
|
||||
|
||||
@OneToMany((_) => MediaUpload, (mediaUpload) => mediaUpload.user)
|
||||
mediaUploads: MediaUpload[];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor() {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue