'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('hotel_bookings', 'payment_status', {
			type: Sequelize.ENUM('Paid', 'Partially Paid', 'Unpaid'),
			allowNull: false,
			defaultValue: 'Unpaid',
		});
		await queryInterface.addColumn('hotel_bookings', 'balance', {
			type: Sequelize.DECIMAL(10, 2),
			allowNull: false,
			defaultValue: 0.0,
		});
		await queryInterface.addColumn('hotel_bookings', 'payment_method', {
			type: Sequelize.STRING,
			allowNull: false,
		});
		await queryInterface.addColumn('hotel_bookings', 'payment', {
			type: Sequelize.DECIMAL(10, 2),
			allowNull: false,
			defaultValue: 0.0,
		});
		await queryInterface.addColumn('hotel_bookings', 'special_request', {
			type: Sequelize.TEXT('long'),
			allowNull: true,
		});
		await queryInterface.addColumn('hotel_bookings', 'first_name', {
			type: Sequelize.STRING,
			allowNull: false,
		});
		await queryInterface.addColumn('hotel_bookings', 'last_name', {
			type: Sequelize.STRING,
			allowNull: false,
		});
		await queryInterface.addColumn('hotel_bookings', 'email', {
			type: Sequelize.STRING,
			allowNull: false,
		});
		await queryInterface.addColumn('hotel_bookings', 'phone', {
			type: Sequelize.STRING,
			allowNull: false,
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('hotel_bookings', 'payment_status');
		await queryInterface.removeColumn('hotel_bookings', 'balance');
		await queryInterface.removeColumn('hotel_bookings', 'payment_method');
		await queryInterface.removeColumn('hotel_bookings', 'payment');
	},
};
