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

export class FrontendObject1732889802526 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table frontend_object (
        id integer generated by default as identity,
        account_id integer not null,
        key text not null,
        value jsonb not null,
        created_at timestamp default now(),
        primary key (id),
        foreign key (account_id) references account(id) on delete cascade,
        unique (key)
      );
      create index frontend_object_account_key_idx on frontend_object(account_id, key);
    `);
  }

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