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