From c0b12bc1668bb68f416747818f877c1a18a0b44a Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Tue, 17 Jan 2023 00:01:14 +1100 Subject: Fix deleting an application if it has a bot --- src/util/entities/Application.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util/entities') diff --git a/src/util/entities/Application.ts b/src/util/entities/Application.ts index e37f5ee5..081b5cf4 100644 --- a/src/util/entities/Application.ts +++ b/src/util/entities/Application.ts @@ -41,7 +41,7 @@ export class Application extends BaseClass { verify_key: string; @JoinColumn({ name: "owner_id" }) - @ManyToOne(() => User) + @ManyToOne(() => User, { onDelete: "CASCADE" }) owner: User; // TODO: enum this? https://discord.com/developers/docs/resources/application#application-object-application-flags @@ -76,7 +76,7 @@ export class Application extends BaseClass { discovery_eligibility_flags: number = 2240; @JoinColumn({ name: "bot_user_id" }) - @OneToOne(() => User) + @OneToOne(() => User, { onDelete: "CASCADE" }) bot?: User; @Column({ type: "simple-array", nullable: true }) -- cgit 1.5.1