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 | f31317851811cd172bf5690671c86a1b514f0d0c (patch) | |
tree | 29daf11ffeab2bd52648d53e0fff0c18d5cf086f /util/src/entities/Recipient.ts | |
parent | added first unittests for api endpoints (diff) | |
download | server-f31317851811cd172bf5690671c86a1b514f0d0c.tar.xz |
:sparkles: delete _ids from entities
Diffstat (limited to 'util/src/entities/Recipient.ts')
-rw-r--r-- | util/src/entities/Recipient.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/util/src/entities/Recipient.ts b/util/src/entities/Recipient.ts new file mode 100644 index 00000000..75d5b94d --- /dev/null +++ b/util/src/entities/Recipient.ts @@ -0,0 +1,19 @@ +import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; +import { BaseClass } from "./BaseClass"; + +@Entity("recipients") +export class Recipient extends BaseClass { + @Column() + @RelationId((recipient: Recipient) => recipient.channel) + channel_id: string; + + @JoinColumn({ name: "channel_id" }) + @ManyToOne(() => require("./Channel").Channel) + channel: import("./Channel").Channel; + + @JoinColumn({ name: "id" }) + @ManyToOne(() => require("./User").User) + user: import("./User").User; + + // TODO: settings/mute/nick/added at/encryption keys/read_state +} |