16 lines
325 B
TypeScript
16 lines
325 B
TypeScript
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
|
|
import { City } from "./city.entity";
|
|
|
|
@Entity()
|
|
export class Province {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
|
name: string;
|
|
|
|
@OneToMany(() => City, (city) => city.province)
|
|
cities: City[];
|
|
}
|