Skip to content

Commit

Permalink
BC-8401 adding missing indexes to groups (#5340)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki-Afro authored Nov 13, 2024
1 parent 3d722f1 commit 97dbb6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/server/src/modules/group/entity/group.entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Embedded, Entity, Enum, ManyToOne, Property } from '@mikro-orm/core';
import { Embedded, Entity, Enum, Index, ManyToOne, Property } from '@mikro-orm/core';
import { ExternalSourceEmbeddable } from '@modules/system/entity';
import { BaseEntityWithTimestamps } from '@shared/domain/entity/base.entity';
import { SchoolEntity } from '@shared/domain/entity/school.entity';
Expand Down Expand Up @@ -34,6 +34,7 @@ export class GroupEntity extends BaseEntityWithTimestamps {
@Property()
name: string;

@Index()
@Enum()
type: GroupEntityTypes;

Expand All @@ -43,9 +44,11 @@ export class GroupEntity extends BaseEntityWithTimestamps {
@Embedded(() => GroupValidPeriodEmbeddable, { nullable: true })
validPeriod?: GroupValidPeriodEmbeddable;

@Index()
@Embedded(() => GroupUserEmbeddable, { array: true })
users: GroupUserEmbeddable[];

@Index()
@ManyToOne(() => SchoolEntity, { nullable: true })
organization?: SchoolEntity;

Expand Down

0 comments on commit 97dbb6b

Please sign in to comment.