From f31317851811cd172bf5690671c86a1b514f0d0c Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 31 Aug 2021 17:54:09 +0200 Subject: :sparkles: delete _ids from entities --- util/src/entities/Recipient.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 util/src/entities/Recipient.ts (limited to 'util/src/entities/Recipient.ts') 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 +} -- cgit 1.4.1