Disable, uninstall and re-install a module / schema with Drush and programmatically

drush dis my_module -y; 
drush pm-uninstall my_module -y; 
drush en my_module -y


Using devel contrib module to re-install it

drush devel-reinstall modulename

All in one: disable, uninstall, enable module.

drush dre my_module1, my_module2

Programmatically

  $modules = [
    'module_one',
    'module_two',
  ];

  // Disable.
  module_disable($modules);
  // Uninstall.
  drupal_uninstall_modules($modules);
  // Install.
  module_enable($modules);

 

********************************** ************************* ************************ **************** ****************** *********** ************** ************* ************ *************