import {Entity, ManyToOne, PrimaryKey, Property} from "@mikro-orm/core"; import {LearningObject} from "./learning-object.entity"; @Entity() export class Attachment { @ManyToOne({entity: () => LearningObject, primary: true}) learningObject!: LearningObject; @PrimaryKey({type: "integer"}) no!: number; @Property({type: "string"}) mimeType!: string; @Property({type: "blob"}) content!: Buffer; }