summary refs log tree commit diff
path: root/util/src/entities/Ban.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Ban.ts')
-rw-r--r--util/src/entities/Ban.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/util/src/entities/Ban.ts b/util/src/entities/Ban.ts
new file mode 100644
index 00000000..ceea4a05
--- /dev/null
+++ b/util/src/entities/Ban.ts
@@ -0,0 +1,34 @@
+import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
+import { BaseClass } from "./BaseClass";
+import { Guild } from "./Guild";
+import { User } from "./User";
+
+@Entity("bans")
+export class Ban extends BaseClass {
+	@Column()
+	user_id: string;
+
+	@JoinColumn({ name: "user_id" })
+	@ManyToOne(() => User, (user: User) => user.id)
+	user: User;
+
+	@Column()
+	guild_id: string;
+
+	@JoinColumn({ name: "guild_id" })
+	@ManyToOne(() => Guild, (guild: Guild) => guild.id)
+	guild: Guild;
+
+	@Column()
+	executor_id: string;
+
+	@JoinColumn({ name: "executor_id" })
+	@ManyToOne(() => User, (user: User) => user.id)
+	executor: User;
+
+	@Column()
+	ip: string;
+
+	@Column()
+	reason?: string;
+}