'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('activities', 'pickup_available', {
			type: Sequelize.BOOLEAN,
			allowNull: false,
			defaultValue: false,
		});
		await queryInterface.addColumn('activities', 'duration', {
			type: Sequelize.STRING,
			allowNull: false,
		});
		await queryInterface.addColumn('activities', 'price', {
			type: Sequelize.DECIMAL(10, 2),
			allowNull: false,
			defaultValue: 0.0,
		});
		await queryInterface.addColumn('activities', 'old_price', {
			type: Sequelize.DECIMAL(10, 2),
			allowNull: true,
			defaultValue: null,
		});
		await queryInterface.addColumn('activities', 'price_type', {
			type: Sequelize.STRING,
			allowNull: true,
			defaultValue: 'per person',
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('activities', 'price_type');
		await queryInterface.removeColumn('activities', 'old_price');
		await queryInterface.removeColumn('activities', 'price');
		await queryInterface.removeColumn('activities', 'duration');
		await queryInterface.removeColumn('activities', 'pickup_available');
	},
};
