'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('members', 'cover_image', {
			type: Sequelize.TEXT,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'bio', {
			type: Sequelize.TEXT,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'birth_date', {
			type: Sequelize.DATEONLY,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'middle_name', {
			type: Sequelize.STRING,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'nationality', {
			type: Sequelize.STRING,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'food_type', {
			type: Sequelize.STRING,
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'gender', {
			type: Sequelize.ENUM('Male', 'Female'),
			allowNull: true,
		});
		await queryInterface.addColumn('members', 'allergy', {
			type: Sequelize.STRING,
			allowNull: true,
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('members', 'cover_image');
		await queryInterface.removeColumn('members', 'bio');
		await queryInterface.removeColumn('members', 'birth_date');
		await queryInterface.removeColumn('members', 'middle_name');
		await queryInterface.removeColumn('members', 'nationality');
		await queryInterface.removeColumn('members', 'food_type');
		await queryInterface.removeColumn('members', 'gender');
		await queryInterface.removeColumn('members', 'allergy');
	},
};
