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

export class ChatMessageScheduled1726478454833 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table chat_message_scheduled (
        id integer generated by default as identity,
        account_id integer not null,
        created_at timestamp without time zone not null,
        send_from integer not null,
        provider_id integer not null,
        title text,
        message text not null,
        send_to text not null,
        entity_id integer not null,
        sent_at timestamp without time zone,
        primary key (id),
        foreign key (account_id) references account(id) on delete cascade,
        foreign key (send_from) references users(id) on delete cascade,
        foreign key (provider_id) references chat_provider(id) on delete cascade,
        foreign key (entity_id) references entity(id) on delete cascade
      );
    `);
  }

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