mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 18:48:11 +00:00
23 lines
722 B
TypeScript
23 lines
722 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Adds PAYMENT_PROCESSING to the invoice status enum: the customer completed
|
|
* provider checkout (success redirect) and settlement is awaiting the
|
|
* provider webhook.
|
|
*/
|
|
export class InvoicePaymentProcessingStatus3260000000000
|
|
implements MigrationInterface
|
|
{
|
|
name = "InvoicePaymentProcessingStatus3260000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TYPE freight.invoices_status_enum ADD VALUE IF NOT EXISTS 'PAYMENT_PROCESSING' AFTER 'PENDING'`,
|
|
);
|
|
}
|
|
|
|
public async down(): Promise<void> {
|
|
// Postgres cannot drop an enum value; PAYMENT_PROCESSING stays. Harmless.
|
|
}
|
|
}
|