diff --git a/services/121-service/src/migration/1729602981695-deprecated-custom-data-key.ts b/services/121-service/src/migration/1729602981695-deprecated-custom-data-key.ts new file mode 100644 index 0000000000..0297145ca5 --- /dev/null +++ b/services/121-service/src/migration/1729602981695-deprecated-custom-data-key.ts @@ -0,0 +1,19 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class DeprecatedCustomDataKey1729602981695 + implements MigrationInterface +{ + name = 'DeprecatedCustomDataKey1729602981695'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "121-service"."program" DROP COLUMN "deprecatedCustomDataKeys"`, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "121-service"."program" ADD "deprecatedCustomDataKeys" json NOT NULL DEFAULT '[]'`, + ); + } +} diff --git a/services/121-service/src/programs/program.entity.ts b/services/121-service/src/programs/program.entity.ts index 88ec99bed5..b9f3a99684 100644 --- a/services/121-service/src/programs/program.entity.ts +++ b/services/121-service/src/programs/program.entity.ts @@ -112,12 +112,6 @@ export class ProgramEntity extends CascadeDeleteEntity { @OneToMany(() => RegistrationEntity, (registrations) => registrations.program) public registrations: Relation; - // Can be used to add deprecated custom attributes to an export if - @Column('json', { - default: [], - }) - public deprecatedCustomDataKeys: unknown[]; - @Column({ default: false }) public tryWhatsAppFirst: boolean; diff --git a/services/121-service/test/program/__snapshots__/create-fsp-configuration.test.ts.snap b/services/121-service/test/program/__snapshots__/create-fsp-configuration.test.ts.snap index 163af62a46..86e92539a0 100644 --- a/services/121-service/test/program/__snapshots__/create-fsp-configuration.test.ts.snap +++ b/services/121-service/test/program/__snapshots__/create-fsp-configuration.test.ts.snap @@ -8,7 +8,6 @@ exports[`Create program questions should create a program with FSP configuration "allowEmptyPhoneNumber": false, "budget": null, "currency": "EUR", - "deprecatedCustomDataKeys": [], "description": { "en": "", }, diff --git a/services/121-service/test/program/__snapshots__/create-program.test.ts.snap b/services/121-service/test/program/__snapshots__/create-program.test.ts.snap index b353e912d4..a9505def26 100644 --- a/services/121-service/test/program/__snapshots__/create-program.test.ts.snap +++ b/services/121-service/test/program/__snapshots__/create-program.test.ts.snap @@ -8,7 +8,6 @@ exports[`Create program should post a program: Create program response for progr "allowEmptyPhoneNumber": false, "budget": null, "currency": "ETB", - "deprecatedCustomDataKeys": [], "description": { "en": "", }, @@ -1071,7 +1070,6 @@ exports[`Create program should post a program: Create program response for progr "allowEmptyPhoneNumber": false, "budget": null, "currency": "EUR", - "deprecatedCustomDataKeys": [], "description": { "en": "", },