Thanks for the feedback Mike. I think you may be correct about message_provider, though it seems odd to have other tables that are related by implication of the name but not of any obvious field.
I shall move on to other subsystems. I now have 47 inferred pk/fk relationships
https://github.com/marcusgreen/moodle_local-sqlgenerator/blob/master/morekeys.xml
And an improved diagram of the relationships between the forum tables.
http://www.examulator.com/er/3.1/components/forum.png