mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 05:18:11 +00:00
35 lines
940 B
TypeScript
35 lines
940 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Add paid column to first_mile and last_mile tables to track invoice payment status.
|
|
*/
|
|
export class AddPaidToFirstAndLastMile1860000000000
|
|
implements MigrationInterface
|
|
{
|
|
name = "AddPaidToFirstAndLastMile1860000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.first_mile
|
|
ADD COLUMN IF NOT EXISTS paid boolean NOT NULL DEFAULT false;
|
|
`);
|
|
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.last_mile
|
|
ADD COLUMN IF NOT EXISTS paid boolean NOT NULL DEFAULT false;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.first_mile
|
|
DROP COLUMN IF EXISTS paid;
|
|
`);
|
|
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.last_mile
|
|
DROP COLUMN IF EXISTS paid;
|
|
`);
|
|
}
|
|
}
|