1 files changed, 9 insertions, 3 deletions
diff --git a/util/src/entities/Invite.ts b/util/src/entities/Invite.ts
index 1396004e..78545b02 100644
--- a/util/src/entities/Invite.ts
+++ b/util/src/entities/Invite.ts
@@ -35,7 +35,9 @@ export class Invite extends BaseClass {
guild_id: string;
@JoinColumn({ name: "guild_id" })
- @ManyToOne(() => Guild)
+ @ManyToOne(() => Guild, {
+ onDelete: "CASCADE",
+ })
guild: Guild;
@Column({ nullable: true })
@@ -43,7 +45,9 @@ export class Invite extends BaseClass {
channel_id: string;
@JoinColumn({ name: "channel_id" })
- @ManyToOne(() => Channel)
+ @ManyToOne(() => Channel, {
+ onDelete: "CASCADE",
+ })
channel: Channel;
@Column({ nullable: true })
@@ -59,7 +63,9 @@ export class Invite extends BaseClass {
target_user_id: string;
@JoinColumn({ name: "target_user_id" })
- @ManyToOne(() => User)
+ @ManyToOne(() => User, {
+ onDelete: "CASCADE",
+ })
target_user?: string; // could be used for "User specific invites" https://github.com/fosscord/fosscord/issues/62
@Column({ nullable: true })
|