update: add province,city,subdistrict,ward in hospital information
This commit is contained in:
@ -5,8 +5,15 @@ import {
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from 'typeorm';
|
||||
|
||||
import { Province } from './province';
|
||||
import { City } from './city';
|
||||
import { Subdistrict } from './subdistrict';
|
||||
import { Ward } from './ward';
|
||||
|
||||
@Entity('hospital_information')
|
||||
export class HospitalInformation {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
@ -36,6 +43,22 @@ export class HospitalInformation {
|
||||
})
|
||||
logo: string;
|
||||
|
||||
@ManyToOne(() => Province, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
province: Province;
|
||||
|
||||
@ManyToOne(() => City, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
city: City;
|
||||
|
||||
@ManyToOne(() => Subdistrict, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
subdistrict: Subdistrict;
|
||||
|
||||
@ManyToOne(() => Ward, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
ward: Ward;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user