You are here

function realname_update_7000 in Real Name 7

Update the {realname} table for Drupal 7.

File

./realname.install, line 107
Installation file for Realname module.

Code

function realname_update_7000() {

  // Add the {realname}.created field if it doesn't already exist.
  if (!db_field_exists('realname', 'created')) {
    $fields['created'] = array(
      'description' => 'The UNIX timestamp of when the real name was created.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'default' => 0,
    );
    db_add_field('realname', 'created', $fields['created']);
  }
  $fields['realname'] = array(
    'description' => 'The generated real name of the user.',
    'type' => 'varchar',
    'length' => '255',
    'not null' => TRUE,
    'default' => '',
  );
  db_change_field('realname', 'realname', 'realname', $fields['realname']);
}