You are here

function system_update_154 in Drupal 4

Same name and namespace in other branches
  1. 5 modules/system/system.install \system_update_154()

File

database/updates.inc, line 1057

Code

function system_update_154() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'contact', 'weight', 'smallint', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      db_add_column($ret, 'contact', 'selected', 'smallint', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN weight tinyint(3) NOT NULL DEFAULT 0");
      $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN selected tinyint(1) NOT NULL DEFAULT 0");
      break;
  }
  return $ret;
}