-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): delete useless indexes
- Loading branch information
Showing
9 changed files
with
73 additions
and
34 deletions.
There are no files selected for viewing
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
Binary file not shown.
48 changes: 48 additions & 0 deletions
48
packages/backend/src/_migrations/1721817064651-auto-migration.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,48 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { domifaConfig } from "../config"; | ||
|
||
export class AutoMigration1721817064651 implements MigrationInterface { | ||
name = "AutoMigration1721817064651"; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
if ( | ||
domifaConfig().envId === "prod" || | ||
domifaConfig().envId === "preprod" || | ||
domifaConfig().envId === "local" | ||
) { | ||
await queryRunner.query( | ||
`DROP INDEX IF EXISTS "public"."IDX_9643302335674f651c0e867235"` | ||
); | ||
await queryRunner.query( | ||
`DROP INDEX IF EXISTS "public"."IDX_2877f8c3f6cbddc785bf938d0a"` | ||
); | ||
await queryRunner.query( | ||
`DROP INDEX IF EXISTS "public"."IDX_bf49c177bbacd36423531ecc07"` | ||
); | ||
await queryRunner.query( | ||
`DROP INDEX IF EXISTS "public"."IDX_c2fa002e6f45fe1ca6c7f23496"` | ||
); | ||
} | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
if ( | ||
domifaConfig().envId === "prod" || | ||
domifaConfig().envId === "preprod" || | ||
domifaConfig().envId === "local" | ||
) { | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_c2fa002e6f45fe1ca6c7f23496" ON "usager_options_history" ("userId") ` | ||
); | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_bf49c177bbacd36423531ecc07" ON "structure" ("departmentName") ` | ||
); | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_2877f8c3f6cbddc785bf938d0a" ON "structure" ("regionName") ` | ||
); | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_9643302335674f651c0e867235" ON "app_log" ("userId") ` | ||
); | ||
} | ||
} | ||
} |
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
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
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
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
4 changes: 2 additions & 2 deletions
4
packages/backend/src/database/services/usager/constants/USAGER_LIGHT_ATTRIBUTES.const.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
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