summary refs log tree commit diff
path: root/util/src/entities/Relationship.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Relationship.ts')
-rw-r--r--util/src/entities/Relationship.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/src/entities/Relationship.ts b/util/src/entities/Relationship.ts
index 61b3ac82..e016b36b 100644
--- a/util/src/entities/Relationship.ts
+++ b/util/src/entities/Relationship.ts
@@ -17,7 +17,9 @@ export class Relationship extends BaseClass {
 	from_id: string;
 
 	@JoinColumn({ name: "from_id" })
-	@ManyToOne(() => User)
+	@ManyToOne(() => User, {
+		onDelete: "CASCADE",
+	})
 	from: User;
 
 	@Column({})
@@ -25,7 +27,9 @@ export class Relationship extends BaseClass {
 	to_id: string;
 
 	@JoinColumn({ name: "to_id" })
-	@ManyToOne(() => User)
+	@ManyToOne(() => User, {
+		onDelete: "CASCADE",
+	})
 	to: User;
 
 	@Column({ nullable: true })