'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('production_nesting', 'nesting_confirmed_quantity', {
      type: Sequelize.DECIMAL(18, 3),
      allowNull: false,
      defaultValue: 0
    });
    await queryInterface.addColumn('production_nesting', 'nesting_file_path', {
      type: Sequelize.STRING(500),
      allowNull: true
    });
    await queryInterface.addColumn('production_nesting', 'nesting_file_name', {
      type: Sequelize.STRING(255),
      allowNull: true
    });
    await queryInterface.addColumn('production_nesting', 'nesting_file_type', {
      type: Sequelize.STRING(100),
      allowNull: true
    });
    await queryInterface.addColumn('production_nesting', 'nesting_file_size', {
      type: Sequelize.INTEGER,
      allowNull: true
    });
  },

  async down(queryInterface) {
    await queryInterface.removeColumn('production_nesting', 'nesting_file_size');
    await queryInterface.removeColumn('production_nesting', 'nesting_file_type');
    await queryInterface.removeColumn('production_nesting', 'nesting_file_name');
    await queryInterface.removeColumn('production_nesting', 'nesting_file_path');
    await queryInterface.removeColumn('production_nesting', 'nesting_confirmed_quantity');
  }
};
