'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.addColumn('tickets', 'is_used', {
			type: Sequelize.BOOLEAN,
			allowNull: false,
			defaultValue: false,
		});
		await queryInterface.addColumn('tickets', 'scanned_datetime', {
			type: Sequelize.DATE,
			allowNull: true,
		});
		await queryInterface.addColumn('tickets', 'scanned_by', {
			type: Sequelize.STRING,
			allowNull: true,
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.removeColumn('tickets', 'is_used');
		await queryInterface.removeColumn('tickets', 'scanned_datetime');
		await queryInterface.removeColumn('tickets', 'scanned_by');
	},
};
