1 files changed, 20 insertions, 2 deletions
diff --git a/src/util/entities/Application.ts b/src/util/entities/Application.ts
index e37f5ee5..94a015e9 100644
--- a/src/util/entities/Application.ts
+++ b/src/util/entities/Application.ts
@@ -1,3 +1,21 @@
+/*
+ Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
+ Copyright (C) 2023 Fosscord and Fosscord Contributors
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
+
import {
Column,
Entity,
@@ -41,7 +59,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 +94,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 })
|