add index to tables

This commit is contained in:
2026-04-09 09:31:20 +03:30
parent 8f6dbc17d3
commit 36d231eb0d
12 changed files with 25 additions and 13 deletions
@@ -1,4 +1,4 @@
import { Collection, Entity, ManyToOne, OptionalProps, Property, OneToMany, Opt } from '@mikro-orm/core';
import { Collection, Entity, ManyToOne, OptionalProps, Property, OneToMany, Opt, Index } from '@mikro-orm/core';
import { Product } from 'src/modules/product/entities/product.entity';
import { BaseEntity } from 'src/common/entities/base.entity';
import { Invoice } from './invoice.entity';
@@ -6,6 +6,7 @@ import { Order } from 'src/modules/order/entities/order.entity';
@Entity({ tableName: 'invoice_items' })
@Index({ properties: ['invoice'] })
export class InvoiceItem extends BaseEntity {
[OptionalProps]?: 'createdAt' | 'deletedAt' | 'discount' | 'description' | 'confirmedAt';