The check_database_schema.php script is great. There are broadly two classes of issues it finds:
1) issues where the schema is broken because of a mis aligned install vs upgrade scripts
2) as above, but so far in the distant past it's hard to repair, and probably has already been repaired in code, but we still need to fix up the db manually for whatever reasons.
Capturing the first class as early as possible I want to tackle here:
But we still need to review and deal with a lot of less than ideal 3rd party code so this is a pragmatic approach to cleaning them, which would happen in parallel to fixing the plugins properly.
Each class of schema misalignment should be able be echo'ed as an sql call and/or the php code needed to fix it by the check script.