|
1 | 1 | import { type MigrationInterface, type QueryRunner } from "typeorm"; |
2 | 2 |
|
3 | | -export class AddPerformanceIndexes1234567890123 implements MigrationInterface { |
| 3 | +export class AddIndexes1738025911271 implements MigrationInterface { |
| 4 | + name = 'AddIndexes1738025911271' |
| 5 | + |
4 | 6 | public async up(queryRunner: QueryRunner): Promise<void> { |
5 | 7 | // Indexes for Pool lookups |
6 | 8 | await queryRunner.query(` |
7 | 9 | CREATE INDEX IF NOT EXISTS idx_pool_chain_allo_pool |
8 | | - ON pool(chain_id, allo_pool_id); |
| 10 | + ON "pool"("chainId", "alloPoolId"); |
9 | 11 | `); |
10 | 12 |
|
11 | 13 | // Indexes for Application lookups |
12 | 14 | await queryRunner.query(` |
13 | 15 | CREATE INDEX IF NOT EXISTS idx_application_pool_chain |
14 | | - ON application(pool_id, chain_id); |
| 16 | + ON "application"("poolId", "chainId"); |
15 | 17 | |
16 | 18 | CREATE INDEX IF NOT EXISTS idx_application_allo_id |
17 | | - ON application(allo_application_id); |
| 19 | + ON "application"("alloApplicationId"); |
18 | 20 | `); |
19 | 21 |
|
20 | 22 | // Indexes for Evaluation lookups |
21 | 23 | await queryRunner.query(` |
22 | 24 | CREATE INDEX IF NOT EXISTS idx_evaluation_application |
23 | | - ON evaluation(application_id); |
| 25 | + ON "evaluation"("applicationId"); |
24 | 26 | |
25 | 27 | CREATE INDEX IF NOT EXISTS idx_evaluation_evaluator |
26 | | - ON evaluation(evaluator, evaluator_type); |
| 28 | + ON "evaluation"("evaluator", "evaluatorType"); |
27 | 29 | |
28 | 30 | CREATE INDEX IF NOT EXISTS idx_evaluation_status |
29 | | - ON evaluation(evaluation_status); |
| 31 | + ON "evaluation"("evaluationStatus"); |
30 | 32 | `); |
31 | 33 |
|
32 | 34 | // Indexes for EvaluationQuestion lookups |
33 | 35 | await queryRunner.query(` |
34 | 36 | CREATE INDEX IF NOT EXISTS idx_eval_question_pool |
35 | | - ON evaluation_question(pool_id, question_index); |
| 37 | + ON "evaluation_question"("poolId", "questionIndex"); |
36 | 38 | `); |
37 | 39 | } |
38 | 40 |
|
|
0 commit comments