category
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Entity, Property, Collection, OneToMany } from '@mikro-orm/core';
|
||||
import { Entity, Property, Collection, OneToMany, ManyToOne } from '@mikro-orm/core';
|
||||
import { Food } from './food.entity';
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
import { Restaurant } from 'src/modules/restaurants/entities/restaurant.entity';
|
||||
|
||||
@Entity({ tableName: 'categories' })
|
||||
export class Category extends BaseEntity {
|
||||
@@ -13,8 +14,8 @@ export class Category extends BaseEntity {
|
||||
@Property({ default: true })
|
||||
isActive: boolean = true;
|
||||
|
||||
@Property({ nullable: true })
|
||||
restId?: string;
|
||||
@ManyToOne(() => Restaurant)
|
||||
restaurant!: Restaurant;
|
||||
|
||||
@Property({ nullable: true })
|
||||
avatarUrl?: string;
|
||||
|
||||
Reference in New Issue
Block a user