mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 15:48:11 +00:00
23 lines
835 B
TypeScript
23 lines
835 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Store WHO made a contract edit as a name, not just an id. Denormalised on
|
|
* purpose: an audit trail must still read correctly after the user is renamed,
|
|
* deactivated or deleted, and `iam.users` lives outside this module's schema.
|
|
*/
|
|
export class AddRevisionActorName2920000000000 implements MigrationInterface {
|
|
name = 'AddRevisionActorName2920000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE freight.contract_document_revisions ADD COLUMN IF NOT EXISTS actor_name varchar(200);`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE freight.contract_document_revisions DROP COLUMN IF EXISTS actor_name;`,
|
|
);
|
|
}
|
|
}
|