You are here

function system_update_170 in Drupal 5

Same name and namespace in other branches
  1. 4 database/updates.inc \system_update_170()

File

modules/system/system.install, line 2592

Code

function system_update_170() {
  if (!variable_get('update_170_done', FALSE)) {
    switch ($GLOBALS['db_type']) {
      case 'pgsql':
        $ret = array();
        db_change_column($ret, 'system', 'schema_version', 'schema_version', 'smallint', array(
          'not null' => TRUE,
          'default' => -1,
        ));
        break;
      case 'mysql':
      case 'mysqli':
        db_query('ALTER TABLE {system} CHANGE schema_version schema_version smallint not null default -1');
        break;
    }

    // Set schema version -1 (uninstalled) for disabled modules (only affects contrib).
    db_query('UPDATE {system} SET schema_version = -1 WHERE status = 0 AND schema_version = 0');
  }
  return array();
}