module provinces
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { City } from '../../provinces/entities/city.entity';
|
||||
import { Province } from '../../provinces/entities/province.entity';
|
||||
import { User } from '../../users/entities/user.entity';
|
||||
|
||||
@Entity('salons')
|
||||
@@ -33,6 +35,20 @@ export class Salon {
|
||||
@JoinColumn({ name: 'ownerId' })
|
||||
owner: User;
|
||||
|
||||
@Column({ nullable: true })
|
||||
provinceId: string | null;
|
||||
|
||||
@ManyToOne(() => Province, { onDelete: 'SET NULL', nullable: true })
|
||||
@JoinColumn({ name: 'provinceId' })
|
||||
province: Province | null;
|
||||
|
||||
@Column({ nullable: true })
|
||||
cityId: string | null;
|
||||
|
||||
@ManyToOne(() => City, { onDelete: 'SET NULL', nullable: true })
|
||||
@JoinColumn({ name: 'cityId' })
|
||||
city: City | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user