diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:54:09 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:54:09 +0200 |
commit | 3d929755fbbfea4aa5119ce2a1bb087269fb69e8 (patch) | |
tree | 0914d47ed52e9a7b156efb01efcd8e3cdc866d24 /util/src/entities/Application.ts | |
parent | added first unittests for api endpoints (diff) | |
download | server-3d929755fbbfea4aa5119ce2a1bb087269fb69e8.tar.xz |
:sparkles: delete _ids from entities
Diffstat (limited to 'util/src/entities/Application.ts')
-rw-r--r-- | util/src/entities/Application.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/util/src/entities/Application.ts b/util/src/entities/Application.ts index b179d171..2092cd4e 100644 --- a/util/src/entities/Application.ts +++ b/util/src/entities/Application.ts @@ -2,6 +2,7 @@ import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; import { BaseClass } from "./BaseClass"; import { Guild } from "./Guild"; import { Team } from "./Team"; +import { User } from "./User"; @Entity("applications") export class Application extends BaseClass { @@ -29,8 +30,9 @@ export class Application extends BaseClass { @Column({ nullable: true }) privacy_policy_url?: string; - @Column() - owner_id: string; + @JoinColumn({ name: "owner_id" }) + @ManyToOne(() => User) + owner?: User; @Column({ nullable: true }) summary?: string; @@ -38,18 +40,12 @@ export class Application extends BaseClass { @Column() verify_key: string; - @RelationId((application: Application) => application.team) - team_id: string; - @JoinColumn({ name: "team_id" }) - @ManyToOne(() => Team, (team: Team) => team.id) + @ManyToOne(() => Team) team?: Team; - @RelationId((application: Application) => application.guild) - guild_id: string; - @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild, (guild: Guild) => guild.id) + @ManyToOne(() => Guild) guild: Guild; // if this application is a game sold, this field will be the guild to which it has been linked @Column({ nullable: true }) |