'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // Check if column exists before adding
    const tableDescription = await queryInterface.describeTable('print_header');
    
    if (!tableDescription.gstin) {
      await queryInterface.addColumn('print_header', 'gstin', {
        type: Sequelize.STRING(15),
        allowNull: true,
        comment: 'GSTIN (GST Identification Number)',
        after: 'website'
      });
    }
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.removeColumn('print_header', 'gstin');
  }
};

