'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.createTable('world_con_tickets', {
			id: {
				type: Sequelize.UUID,
				defaultValue: Sequelize.UUIDV4,
				allowNull: false,
				primaryKey: true,
			},
			title: {
				type: Sequelize.STRING,
				allowNull: false,
			},
			description: {
				type: Sequelize.TEXT,
				allowNull: true,
			},
			image: {
				type: Sequelize.STRING,
				allowNull: true,
			},
			location: {
				type: Sequelize.STRING,
				allowNull: true,
			},
			start_date: {
				type: Sequelize.DATE,
				allowNull: false,
			},
			end_date: {
				type: Sequelize.DATE,
				allowNull: false,
			},
			early_bird_price: {
				type: Sequelize.DECIMAL(10, 2),
				allowNull: true,
			},
			regular_price: {
				type: Sequelize.DECIMAL(10, 2),
				allowNull: true,
			},
			late_registration_price: {
				type: Sequelize.DECIMAL(10, 2),
				allowNull: true,
			},
			expiry_date: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			registration_start: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			early_bird_end: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			regular_end: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			registration_end: {
				type: Sequelize.DATE,
				allowNull: true,
			},
			createdAt: {
				type: Sequelize.DATE,
				allowNull: false,
				defaultValue: Sequelize.NOW,
			},
			updatedAt: {
				type: Sequelize.DATE,
				allowNull: false,
				defaultValue: Sequelize.NOW,
			},
		});
	},

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