20 lines
478 B
TypeScript
20 lines
478 B
TypeScript
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
|
import { LearningObject } from './learning-object.entity.js';
|
|
|
|
@Entity()
|
|
export class Attachment {
|
|
@ManyToOne({
|
|
entity: () => LearningObject,
|
|
primary: true,
|
|
})
|
|
learningObject!: LearningObject;
|
|
|
|
@PrimaryKey({ type: 'integer' })
|
|
sequenceNumber!: number;
|
|
|
|
@Property({ type: 'string' })
|
|
mimeType!: string;
|
|
|
|
@Property({ type: 'blob' })
|
|
content!: Buffer;
|
|
}
|