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

export class FormSiteLink1717773341006 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      CREATE TABLE site_form_link (
        id integer GENERATED BY DEFAULT AS IDENTITY,
        account_id integer NOT NULL,
        form_id integer NOT NULL,
        type text NOT NULL,
        object_id integer NOT NULL,
        PRIMARY KEY (id),
        FOREIGN KEY (account_id) REFERENCES account(id) ON DELETE CASCADE,
        FOREIGN KEY (form_id) REFERENCES site_form(id) ON DELETE CASCADE
      );
    `);
  }

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