Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprected custom data keys #5954

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading