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

export class SalesPlan1695201739381 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table sales_plan (
        id integer generated by default as identity,
        account_id integer not null,
        created_at timestamp without time zone not null,
        entity_type_id integer not null,
        user_id integer not null,
        start_date timestamp without time zone not null,
        end_date timestamp without time zone not null,
        quantity integer,
        amount bigint,
        primary key (id),
        foreign key (account_id) references account(id) on delete cascade,
        foreign key (entity_type_id) references entity_type(id) on delete cascade,
        foreign key (user_id) references users(id) on delete cascade
      );  
    `);
  }

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