fix(backend): Fouten in entity-definities gecorrigeerd.
This commit is contained in:
parent
d5101737ef
commit
4d3964c31f
6 changed files with 17 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
import {ManyToOne, PrimaryKey, Property} from "@mikro-orm/core";
|
||||
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;
|
||||
|
|
|
@ -19,7 +19,7 @@ export class LearningObject {
|
|||
@Property({type: "string"})
|
||||
title!: string;
|
||||
|
||||
@Property({type: "longtext"})
|
||||
@Property({type: "text"})
|
||||
description!: string;
|
||||
|
||||
@Property({type: "string"})
|
||||
|
@ -58,7 +58,7 @@ export class LearningObject {
|
|||
@Property({type: "string", nullable: true})
|
||||
contentLocation?: string;
|
||||
|
||||
@OneToMany({entity: Attachment})
|
||||
@OneToMany({entity: () => Attachment, mappedBy: "learningObject"})
|
||||
attachments: Attachment[] = [];
|
||||
|
||||
@Property({type: "blob"})
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
import {Embeddable, Embedded, Entity, Enum, OneToOne, Property} from "@mikro-orm/core";
|
||||
import {Embeddable, Embedded, Entity, Enum, OneToOne, PrimaryKey, Property} from "@mikro-orm/core";
|
||||
import {Language} from "./language";
|
||||
|
||||
@Entity()
|
||||
export class LearningPath {
|
||||
@Enum({items: () => Language})
|
||||
@PrimaryKey({type: "string"})
|
||||
hruid!: string;
|
||||
|
||||
@Enum({items: () => Language, primary: true})
|
||||
language!: Language;
|
||||
|
||||
@Property({type: "string"})
|
||||
title!: string;
|
||||
|
||||
@Property({type: "longtext"})
|
||||
@Property({type: "text"})
|
||||
description!: string;
|
||||
|
||||
@Property({type: "blob"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue