"use strict";

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.addColumn("KybDirectors", "isBeneficialOwner", {
      type: Sequelize.BOOLEAN,
      defaultValue: false,
      allowNull: false,
    });

    await queryInterface.addColumn("KybDirectors", "isDirector", {
      type: Sequelize.BOOLEAN,
      defaultValue: true,
      allowNull: false,
    });

    await queryInterface.addColumn("KybDirectors", "bvn", {
      type: Sequelize.STRING,
      allowNull: true,
    });

    await queryInterface.addColumn("KybDirectors", "gender", {
      type: Sequelize.STRING,
      allowNull: true,
    });

    await queryInterface.addColumn("KybDirectors", "dateOfBirth", {
      type: Sequelize.DATEONLY,
      allowNull: true,
    });

    await queryInterface.addColumn("KybDirectors", "residentialAddress", {
      type: Sequelize.TEXT,
      allowNull: true,
    });

    await queryInterface.addColumn("KybDirectors", "proofOfAddressUrl", {
      type: Sequelize.STRING,
      allowNull: true,
    });
  },

  down: async (queryInterface) => {
    await queryInterface.removeColumn("KybDirectors", "isBeneficialOwner");
    await queryInterface.removeColumn("KybDirectors", "isDirector");
    await queryInterface.removeColumn("KybDirectors", "bvn");
    await queryInterface.removeColumn("KybDirectors", "gender");
    await queryInterface.removeColumn("KybDirectors", "dateOfBirth");
    await queryInterface.removeColumn("KybDirectors", "residentialAddress");
    await queryInterface.removeColumn("KybDirectors", "proofOfAddressUrl");
  },
};
