'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		await queryInterface.createTable('notifications', {
			id: {
				type: Sequelize.UUID,
				defaultValue: Sequelize.UUIDV4,
				primaryKey: true,
				allowNull: false,
			},
			member_id: {
				type: Sequelize.UUID,
				allowNull: false,
			},
			post_id: {
				type: Sequelize.UUID,
				allowNull: true,
			},
			type: {
				type: Sequelize.STRING,
				allowNull: true,
			},
			is_read: {
				type: Sequelize.BOOLEAN,
				allowNull: false,
				defaultValue: false,
			},
			description: {
				type: Sequelize.TEXT,
				allowNull: false,
			},
			createdAt: {
				type: Sequelize.DATE,
				allowNull: false,
				defaultValue: Sequelize.NOW,
			},
		});
	},

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