add index to tables
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ManyToOne,
|
||||
Property,
|
||||
OptionalProps,
|
||||
Index,
|
||||
} from '@mikro-orm/core';
|
||||
import { User } from "../../user/entities/user.entity";
|
||||
import { Admin } from 'src/modules/admin/entities/admin.entity';
|
||||
@@ -10,10 +11,10 @@ import { AttachmentType } from '../interfaces/chat';
|
||||
import { BaseEntity } from 'src/common/entities/base.entity';
|
||||
|
||||
@Entity()
|
||||
@Index({ properties: ['user'] })
|
||||
export class Chat extends BaseEntity {
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt'
|
||||
|
||||
|
||||
@Property({ type: 'text' })
|
||||
content: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user