'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('material_plant', 'opening_balance_cgst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0.0,
      comment: 'Opening balance valuation: CGST rate % (intra-state)'
    });
    await queryInterface.addColumn('material_plant', 'opening_balance_sgst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0.0,
      comment: 'Opening balance valuation: SGST rate % (intra-state)'
    });
    await queryInterface.addColumn('material_plant', 'opening_balance_igst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0.0,
      comment: 'Opening balance valuation: IGST rate % (inter-state)'
    });
  },

  async down(queryInterface) {
    await queryInterface.removeColumn('material_plant', 'opening_balance_cgst_rate');
    await queryInterface.removeColumn('material_plant', 'opening_balance_sgst_rate');
    await queryInterface.removeColumn('material_plant', 'opening_balance_igst_rate');
  }
};
