'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('subcontract_dc', 'total_amount', {
      type: Sequelize.DECIMAL(18, 2),
      allowNull: false,
      defaultValue: 0
    });

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

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

  async down(queryInterface) {
    await queryInterface.removeColumn('subcontract_dc_item', 'line_total');
    await queryInterface.removeColumn('subcontract_dc_item', 'unit_price');
    await queryInterface.removeColumn('subcontract_dc', 'total_amount');
  }
};
