mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 15:25:45 +00:00
27 lines
978 B
TypeScript
27 lines
978 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Adds the currency-level DJF switch to `manual_payment_settings`.
|
|
*
|
|
* Distinct from `djf_enabled`, which governs only the MANUAL rail: this one
|
|
* says whether DJF may be used as a payment currency at all — offered on the
|
|
* booking forms and accepted for online payment. Defaults to `true`, the
|
|
* behaviour before the switch existed.
|
|
*/
|
|
export class AddDjfPaymentsEnabled3890000000000 implements MigrationInterface {
|
|
name = 'AddDjfPaymentsEnabled3890000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.manual_payment_settings
|
|
ADD COLUMN IF NOT EXISTS djf_payments_enabled boolean NOT NULL DEFAULT true;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.manual_payment_settings DROP COLUMN IF EXISTS djf_payments_enabled;
|
|
`);
|
|
}
|
|
}
|