/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-function */
import type { MigrationInterface, QueryRunner } from 'typeorm';

export class EntityStageChange1708088397272 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table entity_stage_history (
        id integer generated by default as identity,
        account_id integer not null,
        entity_id integer not null,
        board_id integer not null,
        stage_id integer not null,
        created_at timestamp without time zone not null,
        primary key (id),
        foreign key (account_id) references account(id) on delete cascade,
        foreign key (entity_id) references entity(id) on delete cascade,
        foreign key (board_id) references board(id) on delete cascade,
        foreign key (stage_id) references stage(id) on delete cascade
      );
    `);
  }

  public async down(_queryRunner: QueryRunner): Promise<void> {}
}
