Skip to content

Commit

Permalink
add indexes for performance πŸš€ via migration
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Aug 4, 2021
1 parent 7525b10 commit 96fcc8c
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddIndexesForPuVSprQueries1627980508000
implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
create index scenario_features_data__scenario_id__idx on scenario_features_data(scenario_id);
create index scenarios_pu_data__scenario_id__idx on scenarios_pu_data(scenario_id);
create index scenario_features_data__feature_class_id__idx on scenario_features_data(feature_class_id);
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
drop index scenario_features_data__scenario_id__idx;
drop index scenarios_pu_data__scenario_id__idx;
drop index scenario_features_data__feature_class_id__idx;
`);
}
}

0 comments on commit 96fcc8c

Please sign in to comment.