17 lines
430 B
TypeScript
17 lines
430 B
TypeScript
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;
|
|
}
|