'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.addColumn('customer_po_item', 'cgst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0
    });

    await queryInterface.addColumn('customer_po_item', 'cgst_amount', {
      type: Sequelize.DECIMAL(18, 2),
      allowNull: false,
      defaultValue: 0
    });

    await queryInterface.addColumn('customer_po_item', 'sgst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0
    });

    await queryInterface.addColumn('customer_po_item', 'sgst_amount', {
      type: Sequelize.DECIMAL(18, 2),
      allowNull: false,
      defaultValue: 0
    });

    await queryInterface.addColumn('customer_po_item', 'igst_rate', {
      type: Sequelize.DECIMAL(5, 2),
      allowNull: false,
      defaultValue: 0
    });

    await queryInterface.addColumn('customer_po_item', 'igst_amount', {
      type: Sequelize.DECIMAL(18, 2),
      allowNull: false,
      defaultValue: 0
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.removeColumn('customer_po_item', 'cgst_rate');
    await queryInterface.removeColumn('customer_po_item', 'cgst_amount');
    await queryInterface.removeColumn('customer_po_item', 'sgst_rate');
    await queryInterface.removeColumn('customer_po_item', 'sgst_amount');
    await queryInterface.removeColumn('customer_po_item', 'igst_rate');
    await queryInterface.removeColumn('customer_po_item', 'igst_amount');
  }
};

