import type { QueryInterface } from 'sequelize';
import { DataTypes } from 'sequelize';

module.exports = {
  up: async (queryInterface: QueryInterface) => {
    await queryInterface.addColumn('tds_26as_entries', 'pan_number', {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: 'PAN from 26AS header (assessee PAN)',
    });
    await queryInterface.addIndex('tds_26as_entries', ['pan_number'], { name: 'idx_tds_26as_pan' });
  },

  down: async (queryInterface: QueryInterface) => {
    await queryInterface.removeIndex('tds_26as_entries', 'idx_tds_26as_pan');
    await queryInterface.removeColumn('tds_26as_entries', 'pan_number');
  },
};
