add relation

This commit is contained in:
AdisakKanthawilang 2024-12-19 11:14:57 +07:00
parent eb1264b885
commit 48dcb3582a
2 changed files with 8 additions and 0 deletions

View file

@ -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 {

View file

@ -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 {