You are here

function number_update_1 in Content Construction Kit (CCK) 5

File

./number.install, line 9

Code

function number_update_1() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'node_field_float_data', 'nid', 'integer', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      db_add_column($ret, 'node_field_int_data', 'nid', 'integer', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {node_field_float_data} ADD COLUMN nid int(10) NOT NULL DEFAULT 0");
      $ret[] = update_sql("ALTER TABLE {node_field_int_data} ADD COLUMN nid int(10) NOT NULL DEFAULT 0");
      break;
  }
  return $ret;
}