add core api
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import { Airport } from "@/database/entities/airport.entity";
|
||||
import { Country } from "@/database/entities/country.entity";
|
||||
import { Hotel } from "@/database/entities/hotel.entity";
|
||||
import {
|
||||
Collection,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Unique,
|
||||
type Rel,
|
||||
} from "@mikro-orm/core";
|
||||
|
||||
@@ -17,10 +12,6 @@ export class City {
|
||||
@PrimaryKey({ type: "varchar", length: 30 })
|
||||
id!: string;
|
||||
|
||||
@Property({ type: "varchar", length: 200 })
|
||||
@Unique()
|
||||
slug!: string;
|
||||
|
||||
@Property({ type: "varchar", length: 100 })
|
||||
name!: string;
|
||||
|
||||
@@ -39,12 +30,4 @@ export class City {
|
||||
onUpdate: () => new Date(),
|
||||
})
|
||||
updatedAt!: Date;
|
||||
|
||||
// Collections
|
||||
|
||||
@OneToMany(() => Airport, (airport) => airport.city)
|
||||
cities = new Collection<City>(this);
|
||||
|
||||
@OneToMany(() => Hotel, (hotel) => hotel.city)
|
||||
hotels = new Collection<Hotel>(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user