mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
17 lines
826 B
TypeScript
17 lines
826 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class ExtendPaymentMethodEnum1782000000002 implements MigrationInterface {
|
|
name = "ExtendPaymentMethodEnum1782000000002";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TYPE freight.payments_method_enum ADD VALUE IF NOT EXISTS 'waafi';`);
|
|
await queryRunner.query(`ALTER TYPE freight.payments_method_enum ADD VALUE IF NOT EXISTS 'card';`);
|
|
await queryRunner.query(`ALTER TYPE freight.payments_method_enum ADD VALUE IF NOT EXISTS 'dmoney';`);
|
|
}
|
|
|
|
public async down(_queryRunner: QueryRunner): Promise<void> {
|
|
// PostgreSQL does not support removing enum values directly.
|
|
// To roll back, recreate the type without the added values and update the column.
|
|
}
|
|
}
|