You are here

function content_update_1002 in Content Construction Kit (CCK) 5

Add display_settings column

File

./content.install, line 381

Code

function content_update_1002() {
  $ret = array();

  // See if this column was already added in 4.7.
  $result = db_fetch_array(db_query_range("SELECT * FROM {node_field_instance}", array(), 0, 1));
  if (isset($result['display_settings'])) {
    return $ret;
  }
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'node_field_instance', 'display_settings', 'text', array(
        'not null' => TRUE,
        'default' => "''",
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {node_field_instance} ADD COLUMN display_settings mediumtext NOT NULL");
      break;
  }
  return $ret;
}