Skip to content

Commit

Permalink
add index to foreign keys on node (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek authored Sep 22, 2022
1 parent 0b84147 commit 36e983c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teammapper-backend/src/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class ConfigService {
},

extra: {
query_timeout: 2000,
statement_timeout: 2000
query_timeout: 20000,
statement_timeout: 20000
},

synchronize: !this.isProduction(),
Expand Down
2 changes: 2 additions & 0 deletions teammapper-backend/src/map/entities/mmpNode.entity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Entity,
Column,
Index,
PrimaryGeneratedColumn,
PrimaryColumn,
ManyToOne,
Expand Down Expand Up @@ -82,6 +83,7 @@ export class MmpNode {
k: number;

@PrimaryColumn('uuid')
@Index()
nodeMapId: string;

@Column({ nullable: true })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {MigrationInterface, QueryRunner} from "typeorm";

export class AddIndexToForeignKeysOnMmpNode1663839669273 implements MigrationInterface {
name = 'AddIndexToForeignKeysOnMmpNode1663839669273'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE INDEX "IDX_19c5208da416d32ea491315716" ON "mmp_node" ("nodeMapId") `);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "public"."IDX_19c5208da416d32ea491315716"`);
}

}

0 comments on commit 36e983c

Please sign in to comment.