reseting the hook_update_n status of a module I'm extending a module I've previously written and it needs some schema changes which I implement in hook_update_N.

I've updated the module's version from 7.x-1.0 to 7.x-1.1 and implemented the foo_update_7100 and it works fine.

The problem is that I've made a mistake inside foo_update_7100 and now that I've fixed it I cannot rerun the 7100 update. I need to create a 7101 one but that doesn't make sense because all my changes are not committed yet.

I've tried reseting the status of the hook_update_n via:

update system set schema_version=-1 where name='foo';

&gt; Query OK, 1 row affected (0.01 sec)
&gt; Rows matched: 1  Changed: 1  Warnings: 0


Then I do drush cc all but drush updatedb -y still gives me "No database updates required".

How can I solve this instead of simply incrementing the hook_update_N number?
FYI, in Drupal 8, the system table has been removed, and this information is now stored in the key_value table.

UPDATE key_value SET value='i:8000;' WHERE collection = 'system.schema' AND name = 'module_name';


(As noted above, the actual value should be less than the hook_update_N() you want to repeat, but higher than or matching the last update that does not need to be repeated.)