summary refs log tree commit diff
path: root/util/src/entities/Attachment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Attachment.ts')
-rw-r--r--util/src/entities/Attachment.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/src/entities/Attachment.ts b/util/src/entities/Attachment.ts
index 82c5ecf5..7b4b17eb 100644
--- a/util/src/entities/Attachment.ts
+++ b/util/src/entities/Attachment.ts
@@ -31,7 +31,9 @@ export class Attachment extends BaseClass {
 	message_id: string;
 
 	@JoinColumn({ name: "message_id" })
-	@ManyToOne(() => require("./Message").Message, (message: import("./Message").Message) => message.attachments)
+	@ManyToOne(() => require("./Message").Message, (message: import("./Message").Message) => message.attachments, {
+		onDelete: "CASCADE",
+	})
 	message: import("./Message").Message;
 
 	@BeforeRemove()