diff --git a/migrations/1723464500207-seedThirdPartyForQAcc.ts b/migrations/1723464500207-seedThirdPartyForQAcc.ts new file mode 100644 index 0000000..3f01d40 --- /dev/null +++ b/migrations/1723464500207-seedThirdPartyForQAcc.ts @@ -0,0 +1,24 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class SeedThirdPartyForQAcc1723464500207 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + if ( + process.env.NODE_ENV === 'test' || + process.env.NODE_ENV === 'development' + ) { + // Create third part record for notifyreward in development and test ENVs + await queryRunner.query(` + INSERT INTO third_party( + "microService", secret, "isActive") + VALUES ('qacc', 'secret', true); + `); + } + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + DELETE FROM third_party + WHERE "microService" = 'qacc'; + `); + } +}