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

export class AddGoogleCalendar1735140161718 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      CREATE TABLE google_calendar (
        id integer GENERATED BY DEFAULT AS IDENTITY,
        account_id integer NOT NULL,
        created_by integer NOT NULL,
        created_at timestamp without time zone NOT NULL DEFAULT now(),
        tokens jsonb NOT NULL,
        calendar_id text NOT NULL,
        title text NOT NULL,
        readonly boolean NOT NULL,
        type text NOT NULL,
        object_id text NOT NULL,
        PRIMARY KEY (id),
        FOREIGN KEY (account_id) REFERENCES account(id) ON DELETE CASCADE,
        FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE
      );
    `);
  }

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