'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.createTable('event_attendies', {
			id: {
				type: Sequelize.UUID,
				defaultValue: Sequelize.UUIDV4,
				primaryKey: true,
				allowNull: false,
			},
			event_id: {
				type: Sequelize.UUID,
				allowNull: false,
			},
			member_id: {
				type: Sequelize.UUID,
				allowNull: false,
			},
			convention_id: {
				type: Sequelize.UUID,
				allowNull: false,
			},
			ticket_id: {
				type: Sequelize.UUID,
				allowNull: false,
			},
			food_stab: {
				type: Sequelize.ENUM('Claimed', 'Not Claimed'),
				allowNull: true,
			},
			convention_center: {
				type: Sequelize.STRING,
				allowNull: true,
			},
			timestamp: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			scanned_by: {
				type: Sequelize.STRING,
				allowNull: true,
			},
			created_at: {
				type: Sequelize.DATE,
				allowNull: false,
				defaultValue: Sequelize.NOW,
			},
			updated_at: {
				type: Sequelize.DATE,
				allowNull: false,
				defaultValue: Sequelize.NOW,
			},
		});
	},

	async down(queryInterface, Sequelize) {
		await queryInterface.dropTable('event_attendies');
	},
};
