module.exports = {
    async up(queryInterface, Sequelize) {
        await queryInterface.createTable("usersCustom_permissionsPermissions", {
            id: {
                type: Sequelize.DataTypes.UUID,
                defaultValue: Sequelize.DataTypes.UUIDV4,
                primaryKey: true,
            },
            users_custom_permissionsId: {
                type: Sequelize.DataTypes.UUID,
                references: {
                    model: "users",
                    key: "id",
                },
                onDelete: "CASCADE",
            },
            permissionId: {
                type: Sequelize.DataTypes.UUID,
                references: {
                    model: "permissions",
                    key: "id",
                },
                onDelete: "CASCADE",
            },
            createdAt: { type: Sequelize.DataTypes.DATE },
            updatedAt: { type: Sequelize.DataTypes.DATE },
        });
    },
    async down(queryInterface, Sequelize) {
        await queryInterface.dropTable("usersCustom_permissionsPermissions");
    }
};