'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.addColumn('production_nesting_confirmation', 'nesting_net_weight', {
      type: Sequelize.DECIMAL(18, 3),
      allowNull: true,
      comment: 'Snapshot of material net weight when nesting group is saved'
    });
    await queryInterface.addColumn('production_nesting_confirmation', 'nesting_gross_weight', {
      type: Sequelize.DECIMAL(18, 3),
      allowNull: true,
      comment: 'Snapshot of material gross weight when nesting group is saved'
    });
    await queryInterface.addColumn('production_nesting_confirmation', 'nesting_weight_uom_code', {
      type: Sequelize.STRING(30),
      allowNull: true,
      comment: 'Weight UOM code snapshot when nesting group is saved'
    });
  },

  down: async (queryInterface) => {
    await queryInterface.removeColumn('production_nesting_confirmation', 'nesting_net_weight');
    await queryInterface.removeColumn('production_nesting_confirmation', 'nesting_gross_weight');
    await queryInterface.removeColumn('production_nesting_confirmation', 'nesting_weight_uom_code');
  }
};
