import { MigrationInterface, QueryRunner } from 'typeorm';

export class DropFileTable1619081929234 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    queryRunner.query('DROP TABLE file');
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE TABLE file (
          id               int          NOT NULL AUTO_INCREMENT,
          publicId         varchar(255) NOT NULL,
          \`key\`          varchar(255) NOT NULL,
          originalFileName varchar(255) NOT NULL,
          createdOn        datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP (6),
          PRIMARY KEY (id)
          )`
    );
  }
}
