'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('activity_reviews', 'booking_id', {
			type: Sequelize.UUID,
			allowNull: true,
			onDelete: 'CASCADE',
		});

		await queryInterface.addColumn('hotel_reviews', 'booking_id', {
			type: Sequelize.UUID,
			allowNull: true,
			onDelete: 'CASCADE',
		});

		await queryInterface.addColumn('restaurant_reviews', 'booking_id', {
			type: Sequelize.UUID,
			allowNull: true,
			onDelete: 'CASCADE',
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('activity_reviews', 'booking_id');
		await queryInterface.removeColumn('hotel_reviews', 'booking_id');
		await queryInterface.removeColumn('restaurant_reviews', 'booking_id');
	},
};
