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
+2 -1
View File
@@ -1,10 +1,11 @@
import { Entity, Property, OneToMany, Collection, Cascade } from '@mikro-orm/core';
import { Entity, Index, Property, OneToMany, Collection, Cascade } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { UserAddress } from './user-address.entity';
import { Order } from 'src/modules/orders/entities/order.entity';
import { normalizePhone } from '../../utils/phone.util';
@Entity({ tableName: 'users' })
@Index({ properties: ['isActive'] })
export class User extends BaseEntity {
@OneToMany(() => Order, order => order.user)
orders = new Collection<Order>(this);