function drush_core_updatedb

8.0.x core.drush.inc drush_core_updatedb()
6.x core.drush.inc drush_core_updatedb()
7.x core.drush.inc drush_core_updatedb()
3.x core.drush.inc drush_core_updatedb()
4.x core.drush.inc drush_core_updatedb()
5.x core.drush.inc drush_core_updatedb()
master core.drush.inc drush_core_updatedb()

Command handler. Execute update.php code from drush.

File

commands/core/core.drush.inc, line 275
Core drush commands.

Code

function drush_core_updatedb() {
  if (drush_get_context('DRUSH_SIMULATE')) {
    drush_log(dt('updatedb command does not support --simulate option.'), 'ok');
    return TRUE;
  }

  drush_include_engine('drupal', 'update', drush_drupal_major_version());
  if (update_main() === FALSE) {
    return FALSE;
  }

  if (drush_drupal_major_version() <= 6) {
    // Clear all caches. We just performed major surgery.
    drush_drupal_cache_clear_all();
  }
  else {
    // Should be unnecessary on D7.
    // On D7 site-upgrade, this cache_clear was leading to:
    // Call to undefined function field_read_fields() in field_sql_storage.install line 17
  }

  drush_log(dt('Finished performing updates.'), 'ok');
}