-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add indexes for performance π via migration
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...ps/geoprocessing/src/migrations/geoprocessing/1627980508000-AddIndexesForPuVSprQueries.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
`); | ||
} | ||
} |