add relation
This commit is contained in:
parent
eb1264b885
commit
48dcb3582a
2 changed files with 8 additions and 0 deletions
|
|
@ -36,6 +36,10 @@ export class DevelopmentOther extends EntityBase {
|
|||
@ManyToOne(() => Development, (development: Development) => development.developmentOthers)
|
||||
@JoinColumn({ name: "developmentId" })
|
||||
development: Development;
|
||||
|
||||
@ManyToOne(() => Province, (province: Province) => province.developmentOthers)
|
||||
@JoinColumn({ name: "developmentId" })
|
||||
province: Province;
|
||||
}
|
||||
|
||||
export class UpdateDevelopmentOther {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Entity, Column, OneToMany } from "typeorm";
|
|||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
import { DevelopmentAddress } from "./DevelopmentAddress";
|
||||
import { DevelopmentOther } from "./DevelopmentOther";
|
||||
|
||||
@Entity("province")
|
||||
export class Province extends EntityBase {
|
||||
|
|
@ -21,6 +22,9 @@ export class Province extends EntityBase {
|
|||
|
||||
@OneToMany(() => Development, (development: Development) => development.provinceActual)
|
||||
developmentActuals: Development[];
|
||||
|
||||
@OneToMany(() => DevelopmentOther, (developmentOther: DevelopmentOther) => developmentOther.province)
|
||||
developmentOthers: Development[];
|
||||
}
|
||||
|
||||
export class CreateProvince {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue