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

export class ExternalSystem1670840721696 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table external_system (
        id smallint generated by default as identity,
        name character varying not null,
        code character varying not null,
        url_template character varying not null,
        primary key (id)
      );

      alter table external_entity
        add column system smallint,
        add foreign key (system) references external_system(id);
    `);
  }

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