category
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Entity, Property, ManyToMany, Collection } from '@mikro-orm/core';
|
||||
import { Foods } from './food.entity';
|
||||
import { BaseEntity } from 'src/common/entities/base.entity';
|
||||
|
||||
@Entity({ tableName: 'categories' })
|
||||
export class Category extends BaseEntity {
|
||||
@Property({ nullable: true })
|
||||
title?: string;
|
||||
|
||||
@ManyToMany(() => Foods, food => food.categories)
|
||||
foods = new Collection<Foods>(this);
|
||||
|
||||
@Property({ default: true })
|
||||
isActive: boolean = true;
|
||||
|
||||
@Property({ nullable: true })
|
||||
restId?: string;
|
||||
|
||||
@Property({ nullable: true })
|
||||
avatarUrl?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user