'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('bom_component', 'component_weight', {
      type: Sequelize.DECIMAL(15, 3),
      allowNull: true,
      comment: 'Defaulted from material master and editable in BOM',
      after: 'component_uom_id',
    });

    await queryInterface.addColumn('bom_component', 'component_height', {
      type: Sequelize.DECIMAL(15, 3),
      allowNull: true,
      comment: 'Defaulted from material master and editable in BOM',
      after: 'component_weight',
    });

    await queryInterface.addColumn('bom_component', 'component_thickness', {
      type: Sequelize.DECIMAL(15, 3),
      allowNull: true,
      comment: 'Defaulted from material master and editable in BOM',
      after: 'component_height',
    });
  },

  async down(queryInterface) {
    await queryInterface.removeColumn('bom_component', 'component_thickness');
    await queryInterface.removeColumn('bom_component', 'component_height');
    await queryInterface.removeColumn('bom_component', 'component_weight');
  },
};
