How to check if a core update, like 4.9.8 → 5.0, involves a database update (migration)?

So after some thinking I came up with this:

Codex / WordPress Versions has Changelogs, but these seem to mention (recent) database upgrades implicitly, starting at 5.0. (Compare how Matomo explicitly states DB upgrades). Maybe this will be enough for future versions, here’s the thorough, cumbersome way that works for older versions, too:

  1. check db_version at Codex / WordPress Versions, or manually/programmatically:
    1. check wp-includes/version.php of the version we are updating from, 4.9.8:
      $wp_db_version = 38590;
    2. repeat for version we are updating to; 5.0: $wp_db_version = 43764;
  2. check upgrade_all in wp-admin/includes/upgrade.php, for 4.9.8→5.0 / 38590→43764:

    // ...
    if ( $wp_current_db_version < 37965 ) // false
        upgrade_460();
    
    if ( $wp_current_db_version < 43764 ) // true!
        upgrade_500();
    
  3. finally, inspecting upgrade_500, reveals some Gutenberg-juggling and a FIXME 🙂

  4. Conclusion: Only very minor database upgrades (one site option is set), so it should be fine, just keep an eye out for Gutenberg & Classic Editor plugin.

UPDATE/EDIT, regarding the “Background”: So I did do a manual update 4.9.9→5.0 and then a manual downgrade 5.0→4.9.9 (4.9.8 and .9 don’t differ DB-wise). I was presented with the “DB Upgrade required” screen both ways, and proceeded. What happens upon downgrade would need more research; my guess is that you only see the screen and none of the upgrade_* functions are executed. After up-and-downgrade everything looks normal, at least for this minimal, fresh install. So I will feel free to upgrade 4.9.8 to 5.0, knowing I can switch back should anything go wrong. YMMV, of course, especially when other plugins and themes are involved. Wouldn’t do it for bigger version jumps, though 🙂