mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 20:10:56 +00:00
25 lines
724 B
TypeScript
25 lines
724 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Store the driver's gender. Prefilled from the Fayda VERIFY response
|
|
* (Male/Female) but editable; nullable so existing rows and manual,
|
|
* non-Fayda driver records stay valid.
|
|
*/
|
|
export class AddDriverGender1890000000005 implements MigrationInterface {
|
|
name = "AddDriverGender1890000000005";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.drivers
|
|
ADD COLUMN IF NOT EXISTS gender varchar
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.drivers
|
|
DROP COLUMN IF EXISTS gender
|
|
`);
|
|
}
|
|
}
|