16 lines
364 B
TypeScript
Executable File
16 lines
364 B
TypeScript
Executable File
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
|
|
import { Province } from "./province.entity";
|
|
|
|
@Entity()
|
|
export class City {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
|
name: string;
|
|
|
|
@ManyToOne(() => Province, (province) => province.cities, { nullable: false })
|
|
province: Province;
|
|
}
|