'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('sales_invoice', 'delivery_note_date', {
      type: Sequelize.DATEONLY,
      allowNull: true
    });
    await queryInterface.addColumn('sales_invoice', 'other_references', {
      type: Sequelize.STRING(255),
      allowNull: true
    });
    await queryInterface.addColumn('sales_invoice', 'motor_vehicle_no', {
      type: Sequelize.STRING(100),
      allowNull: true
    });
    await queryInterface.addColumn('sales_invoice', 'mode_terms_of_payment', {
      type: Sequelize.STRING(255),
      allowNull: true
    });
    await queryInterface.addColumn('sales_invoice', 'terms_of_delivery', {
      type: Sequelize.STRING(255),
      allowNull: true,
      defaultValue: 'By Road'
    });
  },

  async down(queryInterface) {
    await queryInterface.removeColumn('sales_invoice', 'terms_of_delivery');
    await queryInterface.removeColumn('sales_invoice', 'mode_terms_of_payment');
    await queryInterface.removeColumn('sales_invoice', 'motor_vehicle_no');
    await queryInterface.removeColumn('sales_invoice', 'other_references');
    await queryInterface.removeColumn('sales_invoice', 'delivery_note_date');
  }
};

