'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.sequelize.transaction(async (transaction) => {
			await queryInterface.addColumn(
				'product_images',
				'type',
				{
					type: Sequelize.ENUM('size', 'color'),
					defaultValue: 'color',
				},
				{ transaction },
			);
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.sequelize.transaction(async (transaction) => {
			await queryInterface.removeColumn('product_images', 'type', { transaction });
		});
	},
};
