mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
25 lines
816 B
TypeScript
25 lines
816 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Wagon status RETIRED is renamed DETAINED (wagons pulled from circulation).
|
|
* The column is a plain varchar, so this is a data-only rename. Vehicles keep
|
|
* their own RETIRED status — only freight.wagons rows are touched.
|
|
*/
|
|
export class RenameWagonStatusRetiredToDetained2230000000000
|
|
implements MigrationInterface
|
|
{
|
|
name = 'RenameWagonStatusRetiredToDetained2230000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
UPDATE freight.wagons SET status = 'DETAINED' WHERE status = 'RETIRED'
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
UPDATE freight.wagons SET status = 'RETIRED' WHERE status = 'DETAINED'
|
|
`);
|
|
}
|
|
}
|