mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
18 lines
866 B
TypeScript
18 lines
866 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class AddCacBankPaymentMethod2460000000000 implements MigrationInterface {
|
|
name = "AddCacBankPaymentMethod2460000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
// The entity + frontend already list 'cac-bank' as a valid method, but the
|
|
// DB enum was never extended. Filtering payments by 'cac-bank' cast the
|
|
// literal to the enum and errored (invalid input value for enum). EDRFREIGHT-301.
|
|
await queryRunner.query(`ALTER TYPE freight.payments_method_enum ADD VALUE IF NOT EXISTS 'cac-bank';`);
|
|
}
|
|
|
|
public async down(_queryRunner: QueryRunner): Promise<void> {
|
|
// PostgreSQL does not support removing enum values directly.
|
|
// To roll back, recreate the type without the added value and update the column.
|
|
}
|
|
}
|