summary refs log tree commit diff
path: root/util/src/entities/Webhook.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
commit16a3d1b334315099a83c64dfd5d3c2fa9386e6fb (patch)
tree114bdb80b0a95ee4c2eec35bb3fdc044adbfe721 /util/src/entities/Webhook.ts
parent:sparkles: route middleware test option (diff)
parent:bug: fix relationships (diff)
downloadserver-16a3d1b334315099a83c64dfd5d3c2fa9386e6fb.tar.xz
Merge branch 'master' into unittests
Diffstat (limited to 'util/src/entities/Webhook.ts')
-rw-r--r--util/src/entities/Webhook.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/util/src/entities/Webhook.ts b/util/src/entities/Webhook.ts

index 12ba0d08..8382435f 100644 --- a/util/src/entities/Webhook.ts +++ b/util/src/entities/Webhook.ts
@@ -32,7 +32,9 @@ export class Webhook extends BaseClass { guild_id: string; @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild) + @ManyToOne(() => Guild, { + onDelete: "CASCADE", + }) guild: Guild; @Column({ nullable: true }) @@ -40,7 +42,9 @@ export class Webhook extends BaseClass { channel_id: string; @JoinColumn({ name: "channel_id" }) - @ManyToOne(() => Channel) + @ManyToOne(() => Channel, { + onDelete: "CASCADE", + }) channel: Channel; @Column({ nullable: true }) @@ -48,7 +52,9 @@ export class Webhook extends BaseClass { application_id: string; @JoinColumn({ name: "application_id" }) - @ManyToOne(() => Application) + @ManyToOne(() => Application, { + onDelete: "CASCADE", + }) application: Application; @Column({ nullable: true }) @@ -56,7 +62,9 @@ export class Webhook extends BaseClass { user_id: string; @JoinColumn({ name: "user_id" }) - @ManyToOne(() => User) + @ManyToOne(() => User, { + onDelete: "CASCADE", + }) user: User; @Column({ nullable: true }) @@ -64,6 +72,8 @@ export class Webhook extends BaseClass { source_guild_id: string; @JoinColumn({ name: "source_guild_id" }) - @ManyToOne(() => Guild) + @ManyToOne(() => Guild, { + onDelete: "CASCADE", + }) source_guild: Guild; }