summary refs log tree commit diff
path: root/util/src/entities/Member.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-20 21:49:42 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-20 21:49:42 +0200
commit5cec6e43d4e193616458a7e9c74a486ceade7e93 (patch)
treed0728474d103bcd6743e365828b342b750902c33 /util/src/entities/Member.ts
parent:sparkles: route middleware test option (diff)
parent:bug: fix relationships (diff)
downloadserver-5cec6e43d4e193616458a7e9c74a486ceade7e93.tar.xz
Merge branch 'master' into unittests
Diffstat (limited to 'util/src/entities/Member.ts')
-rw-r--r--util/src/entities/Member.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index 66f5d9a1..feb9c069 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -39,7 +39,9 @@ export class Member extends BaseClassWithoutId {
 	id: string;
 
 	@JoinColumn({ name: "id" })
-	@ManyToOne(() => User)
+	@ManyToOne(() => User, {
+		onDelete: "CASCADE",
+	})
 	user: User;
 
 	@Column()
@@ -47,7 +49,9 @@ export class Member extends BaseClassWithoutId {
 	guild_id: string;
 
 	@JoinColumn({ name: "guild_id" })
-	@ManyToOne(() => Guild)
+	@ManyToOne(() => Guild, {
+		onDelete: "CASCADE",
+	})
 	guild: Guild;
 
 	@Column({ nullable: true })
@@ -55,7 +59,6 @@ export class Member extends BaseClassWithoutId {
 
 	@JoinTable({
 		name: "member_roles",
-
 		joinColumn: { name: "index", referencedColumnName: "index" },
 		inverseJoinColumn: {
 			name: "role_id",