If I’m running database updates on a Drupal site and there is some question about whether or not the update fired, I can check this in the database itself from the command line.
Every module that has database updates will define these in their install file, ex. ctools.install and that file will have a number of install hooks that reference the schema number, ex:
/**
* Revert the length of the ctools_object_cache.name column back to 128.
*/
function ctools_update_7003() {
When a module install hook successfully runs, the schema version for it is updated to this number in the database. In the above example, the ctools schema version for that update hook (the last one) is 7003, which should be the latest version.
In Drupal 7, I would check that against the systems table with a quick SQL query:
mysql> select name,schema_version from system where name="ctools";
+--------+----------------+
| name | schema_version |
+--------+----------------+
| ctools | 7003 |
+--------+----------------+
1 row in set (0.01 sec)
In Drupal 8, this is done in the key_value table and the schema is separated out so the SQL query is simply:
select * from key_value where name="ctools" and collection='system.schema';
+---------------+--------+---------+
| collection | name | value |
+---------------+--------+---------+
| system.schema | ctools | i:8000; |
+---------------+--------+---------+
1 row in set (0.01 sec)