mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
31 lines
946 B
TypeScript
31 lines
946 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Allow DOMESTIC trade direction on weight_limit_rules (domestic corridor bookings).
|
|
*/
|
|
export class AddDomesticWeightLimitTradeDirection1781000000004
|
|
implements MigrationInterface
|
|
{
|
|
name = 'AddDomesticWeightLimitTradeDirection1781000000004';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
DO $$ BEGIN
|
|
ALTER TYPE freight.weight_limit_rules_trade_direction_enum ADD VALUE 'DOMESTIC';
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN NULL;
|
|
WHEN undefined_object THEN
|
|
BEGIN
|
|
ALTER TYPE weight_limit_rules_trade_direction_enum ADD VALUE 'DOMESTIC';
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN NULL;
|
|
END;
|
|
END $$;
|
|
`);
|
|
}
|
|
|
|
public async down(_queryRunner: QueryRunner): Promise<void> {
|
|
// PostgreSQL does not support removing enum values safely.
|
|
}
|
|
}
|