'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('purchase_costing', 'purchase_costing_number', {
      type: Sequelize.STRING(80),
      allowNull: true
    });
    await queryInterface.addIndex('purchase_costing', ['purchase_costing_number'], {
      name: 'purchase_costing_number_uq',
      unique: true
    });
  },

  async down(queryInterface) {
    await queryInterface.removeIndex('purchase_costing', 'purchase_costing_number_uq');
    await queryInterface.removeColumn('purchase_costing', 'purchase_costing_number');
  }
};
