21 lines
500 B
TypeScript
21 lines
500 B
TypeScript
import { Entity, Index, Property, ManyToOne } from '@mikro-orm/core';
|
|
import { BaseEntity } from '../../../common/entities/base.entity';
|
|
import { Group } from './group.entity';
|
|
|
|
@Entity({ tableName: 'icons' })
|
|
@Index({ properties: ['isActive'] })
|
|
@Index({ properties: ['group', 'isActive'] })
|
|
export class Icon extends BaseEntity {
|
|
@Property()
|
|
name!: string;
|
|
|
|
@Property()
|
|
url!: string;
|
|
|
|
@Property({ default: true })
|
|
isActive: boolean = true;
|
|
|
|
@ManyToOne(() => Group)
|
|
group!: Group;
|
|
}
|