add index

This commit is contained in:
2025-12-11 18:37:50 +03:30
parent a54e8eb9f3
commit 49ec05b410
12 changed files with 42 additions and 11 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
import { PrimaryKey, Property, Filter, OptionalProps } from '@mikro-orm/core';
import { Index, PrimaryKey, Property, Filter, OptionalProps } from '@mikro-orm/core';
import { ulid } from 'ulid';
@Filter({ name: 'notDeleted', cond: { deletedAt: null }, default: true })
@Index({ properties: ['deletedAt'] })
@Index({ properties: ['createdAt'] })
export abstract class BaseEntity {
[OptionalProps]?: 'id' | 'createdAt' | 'updatedAt' | 'deletedAt';