summary refs log tree commit diff
path: root/util/src/entities/Template.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Template.ts')
-rw-r--r--util/src/entities/Template.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/src/entities/Template.ts b/util/src/entities/Template.ts
index 5c9a5120..c8d2034c 100644
--- a/util/src/entities/Template.ts
+++ b/util/src/entities/Template.ts
@@ -1,4 +1,4 @@
-import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
+import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
 import { BaseClass } from "./BaseClass";
 import { Guild } from "./Guild";
 import { User } from "./User";
@@ -17,6 +17,9 @@ export class Template extends BaseClass {
 	@Column()
 	usage_count?: number;
 
+	@RelationId((template: Template) => template.creator)
+	creator_id: string;
+
 	@JoinColumn({ name: "creator_id" })
 	@ManyToOne(() => User, (user: User) => user.id)
 	creator: User;
@@ -27,6 +30,9 @@ export class Template extends BaseClass {
 	@Column()
 	updated_at: Date;
 
+	@RelationId((template: Template) => template.source_guild)
+	source_guild_id: string;
+
 	@JoinColumn({ name: "source_guild_id" })
 	@ManyToOne(() => Guild, (guild: Guild) => guild.id)
 	source_guild: Guild;