'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('tickets', 'purchased_at', {
			type: Sequelize.DATE,
			allowNull: true,
			defaultValue: Sequelize.NOW,
		});
		await queryInterface.addColumn('tickets', 'purchased_by', {
			type: Sequelize.UUID,
			allowNull: true,
		});
		await queryInterface.addColumn('tickets', 'worldcon_ticket_id', {
			type: Sequelize.UUID,
			allowNull: true,
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('tickets', 'purchased_at');
		await queryInterface.removeColumn('tickets', 'purchased_by');
		await queryInterface.removeColumn('tickets', 'worldcon_ticket_id');
	},
};
