-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor MonitorTest table to remove "lastMonitoringLog" column and a…
…dd "monitorStepProbeResponse" and "isInQueue" columns
- Loading branch information
Showing
5 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
37 changes: 23 additions & 14 deletions
37
Common/Server/Infrastructure/Postgres/SchemaMigrations/1730223198692-MigrationName.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 |
---|---|---|
@@ -1,20 +1,29 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class MigrationName1730223198692 implements MigrationInterface { | ||
public name = 'MigrationName1730223198692' | ||
public name = "MigrationName1730223198692"; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "MonitorTest" DROP COLUMN "lastMonitoringLog"`); | ||
await queryRunner.query(`ALTER TABLE "MonitorTest" ADD "monitorStepProbeResponse" jsonb`); | ||
await queryRunner.query(`ALTER TABLE "MonitorTest" ADD "isInQueue" boolean DEFAULT true`); | ||
|
||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
|
||
await queryRunner.query(`ALTER TABLE "MonitorTest" DROP COLUMN "isInQueue"`); | ||
await queryRunner.query(`ALTER TABLE "MonitorTest" DROP COLUMN "monitorStepProbeResponse"`); | ||
await queryRunner.query(`ALTER TABLE "MonitorTest" ADD "lastMonitoringLog" jsonb`); | ||
} | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" DROP COLUMN "lastMonitoringLog"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" ADD "monitorStepProbeResponse" jsonb`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" ADD "isInQueue" boolean DEFAULT true`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" DROP COLUMN "isInQueue"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" DROP COLUMN "monitorStepProbeResponse"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "MonitorTest" ADD "lastMonitoringLog" jsonb`, | ||
); | ||
} | ||
} |
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