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

export class AddRentalSchedule1691414938591 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      create table rental_schedule (
        id integer generated by default as identity,
        product_id integer not null,
        order_item_id integer not null,
        start_date timestamp without time zone not null,
        end_date timestamp without time zone not null,
        status character varying not null,
        account_id integer not null,
        primary key (id),
        foreign key (product_id) references product(id) on delete cascade,
        foreign key (order_item_id) references rental_order_item(id) on delete cascade,
        foreign key (account_id) references account(id) on delete cascade
      );  
    `);
  }

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