summary refs log tree commit diff
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-01-24 20:51:16 +0300
committerGitHub <noreply@github.com>2022-01-24 20:51:16 +0300
commitc824c32234e60b6ded2bc2d4ef8a53655fcd1eb0 (patch)
treeb9b7f4988e74e3c4d011688592b33a53567d0f0d
parentAdd dummy endpoints to prevent client loading some settings panels indefinitely (diff)
parentFixed potential guild message SQL constraints (diff)
downloadserver-c824c32234e60b6ded2bc2d4ef8a53655fcd1eb0.tar.xz
Merge pull request #555 from unknownPerson115/patch-1
Fixed potential guild message SQL constraints
-rw-r--r--util/src/entities/Message.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/src/entities/Message.ts b/util/src/entities/Message.ts
index 20a44ca3..e577d5df 100644
--- a/util/src/entities/Message.ts
+++ b/util/src/entities/Message.ts
@@ -84,8 +84,10 @@ export class Message extends BaseClass {
 	@RelationId((message: Message) => message.member)
 	member_id: string;
 
-	@JoinColumn({ name: "member_id" })
-	@ManyToOne(() => Member)
+	@JoinColumn({ name: "author_id", referencedColumnName: "id" })
+	@ManyToOne(() => User, {
+		onDelete: "CASCADE",
+	})
 	member?: Member;
 
 	@Column({ nullable: true })