import { MigrationInterface, QueryRunner } from 'typeorm';

export class DropOffboardingTables1786195500000 implements MigrationInterface {
  name = 'DropOffboardingTables1786195500000';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('SET FOREIGN_KEY_CHECKS = 0;');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_checklist_items`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_cases`');
    await queryRunner.query('DROP TABLE IF EXISTS `exit_interviews`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_tasks`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_records`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_plans`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_requests`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_clearances`');
    await queryRunner.query('DROP TABLE IF EXISTS `offboarding_assets`');
    await queryRunner.query('SET FOREIGN_KEY_CHECKS = 1;');
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    // No down action needed for table purge
  }
}
