mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
21 lines
667 B
TypeScript
21 lines
667 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class AddFanNumberToCompanies1749300000000 implements MigrationInterface {
|
|
name = 'AddFanNumberToCompanies1749300000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
// fan_number may already exist when CreateCompaniesModule ran with the full schema
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.companies
|
|
ADD COLUMN IF NOT EXISTS fan_number varchar(16) NULL;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.companies
|
|
DROP COLUMN IF EXISTS fan_number;
|
|
`);
|
|
}
|
|
}
|