Remove orphaned module data after uninstall
Use following database query to remove the module:

Drupal 8

DELETE FROM key_value WHERE collection='system.schema' AND name='module_name'


Drupal 7

DELETE from system where name = 'old_module1' AND type = 'module'


See: How to fix "The following module is missing from the file system..." warning messages.