diff options
Diffstat (limited to 'util/src/entities/VoiceState.ts')
-rw-r--r-- | util/src/entities/VoiceState.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/util/src/entities/VoiceState.ts b/util/src/entities/VoiceState.ts index 2416c6c0..6707a575 100644 --- a/util/src/entities/VoiceState.ts +++ b/util/src/entities/VoiceState.ts @@ -1,4 +1,4 @@ -import { Column, Entity, JoinColumn, ManyToOne, OneToOne } from "typeorm"; +import { Column, Entity, JoinColumn, ManyToOne, OneToOne, RelationId } from "typeorm"; import { BaseClass } from "./BaseClass"; import { Channel } from "./Channel"; import { Guild } from "./Guild"; @@ -6,14 +6,23 @@ import { User } from "./User"; @Entity("voice_states") export class VoiceState extends BaseClass { + @RelationId((voice_state: VoiceState) => voice_state.guild) + guild_id: string; + @JoinColumn({ name: "guild_id" }) @ManyToOne(() => Guild, (guild: Guild) => guild.id) guild?: Guild; + @RelationId((voice_state: VoiceState) => voice_state.channel) + channel_id: string; + @JoinColumn({ name: "channel_id" }) @ManyToOne(() => Channel, (channel: Channel) => channel.id) channel: Channel; + @RelationId((voice_state: VoiceState) => voice_state.user) + user_id: string; + @JoinColumn({ name: "user_id" }) @ManyToOne(() => User, (user: User) => user.id) user: User; |