เพิ่มตำแหน่งเลือกได้หลายอัน

This commit is contained in:
Kittapath 2024-04-09 21:59:23 +07:00
parent 68c31be431
commit 166c919bbe
10 changed files with 424 additions and 115 deletions

View file

@ -1,4 +1,4 @@
import { Entity, Column, OneToMany } from "typeorm";
import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
@ -12,8 +12,9 @@ export class Province extends EntityBase {
})
name: string;
@OneToMany(() => Development, (development: Development) => development.province)
developments: Development[];
@ManyToMany(() => Development, (development) => development.provinces)
@JoinTable()
developmentProvinces: Development[];
@OneToMany(() => Development, (development: Development) => development.provinceActual)
developmentActuals: Development[];