"use strict";

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.addColumn("Transactions", "old_balance", {
      type: Sequelize.DECIMAL(20, 2),
      allowNull: true,
      comment: "Balance of the primary affected account (customer if set, otherwise merchant) immediately before this transaction's balance change.",
    });
    await queryInterface.addColumn("Transactions", "new_balance", {
      type: Sequelize.DECIMAL(20, 2),
      allowNull: true,
      comment: "Balance of the primary affected account (customer if set, otherwise merchant) immediately after this transaction's balance change.",
    });
  },

  down: async (queryInterface) => {
    await queryInterface.removeColumn("Transactions", "old_balance");
    await queryInterface.removeColumn("Transactions", "new_balance");
  },
};
