diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 14:09:54 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 14:09:54 +0200 |
commit | 2f623b2a2276321b74c4601f67f5236be2ae5243 (patch) | |
tree | e115399283f6572b3e80b5fc5b01cb0554f6d96d /util/src/entities/Emoji.ts | |
parent | :bug: fix cdn route not working without hash (diff) | |
download | server-2f623b2a2276321b74c4601f67f5236be2ae5243.tar.xz |
:art: emoji db migration
Diffstat (limited to 'util/src/entities/Emoji.ts')
-rw-r--r-- | util/src/entities/Emoji.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/util/src/entities/Emoji.ts b/util/src/entities/Emoji.ts index a252d9f4..03218375 100644 --- a/util/src/entities/Emoji.ts +++ b/util/src/entities/Emoji.ts @@ -1,4 +1,5 @@ -import { Column, Entity, JoinColumn, ManyToOne } from "typeorm"; +import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; +import { User } from "."; import { BaseClass } from "./BaseClass"; import { Guild } from "./Guild"; import { Role } from "./Role"; @@ -20,6 +21,14 @@ export class Emoji extends BaseClass { }) guild: Guild; + @Column({ nullable: true }) + @RelationId((emoji: Emoji) => emoji.user) + user_id: string; + + @JoinColumn({ name: "user_id" }) + @ManyToOne(() => User) + user: User; + @Column() managed: boolean; @@ -28,4 +37,7 @@ export class Emoji extends BaseClass { @Column() require_colons: boolean; + + @Column({ type: "simple-array" }) + roles: string[]; // roles this emoji is whitelisted to (new discord feature?) } |