"use strict";

module.exports = {
	async up(queryInterface, Sequelize) {
		const tableName = "employees";
		const table = await queryInterface.describeTable(tableName);
		if (!table.job_role) {
			await queryInterface.addColumn(tableName, "job_role", {
				type: Sequelize.STRING(100),
				allowNull: true,
			});
		}
	},

	async down(queryInterface) {
		const tableName = "employees";
		const table = await queryInterface.describeTable(tableName);
		if (table.job_role) {
			await queryInterface.removeColumn(tableName, "job_role");
		}
	},
};
