Skip to content

Commit

Permalink
Remove deprected custom data keys (#5954)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben <vandervalk@geoit.nl>
  • Loading branch information
RubenGeo and Ruben authored Oct 23, 2024
1 parent dbae23c commit 6da16e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class DeprecatedCustomDataKey1729602981695
implements MigrationInterface
{
name = 'DeprecatedCustomDataKey1729602981695';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "121-service"."program" DROP COLUMN "deprecatedCustomDataKeys"`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "121-service"."program" ADD "deprecatedCustomDataKeys" json NOT NULL DEFAULT '[]'`,
);
}
}
6 changes: 0 additions & 6 deletions services/121-service/src/programs/program.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ export class ProgramEntity extends CascadeDeleteEntity {
@OneToMany(() => RegistrationEntity, (registrations) => registrations.program)
public registrations: Relation<RegistrationEntity[]>;

// Can be used to add deprecated custom attributes to an export if
@Column('json', {
default: [],
})
public deprecatedCustomDataKeys: unknown[];

@Column({ default: false })
public tryWhatsAppFirst: boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Create program questions should create a program with FSP configuration
"allowEmptyPhoneNumber": false,
"budget": null,
"currency": "EUR",
"deprecatedCustomDataKeys": [],
"description": {
"en": "",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
},
Expand Down Expand Up @@ -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": "",
},
Expand Down

0 comments on commit 6da16e3

Please sign in to comment.