flag_update_6002

Versions
6
flag_update_6002()

Add a 'serial' primary key, fcid, to the flag_content table.

Code

contributions/flag/flag.install, line 430

<?php
function flag_update_6002() {
  $ret = array();

  if (db_column_exists('flag_content', 'fcid')) {
    db_drop_primary_key($ret, 'flag_content');
    db_add_field($ret, 'flag_content', 'fcid', array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ), array(
        'primary key' => array('fcid'),
      )
    );
    db_add_unique_key($ret, 'flag_content', 'fid_content_type_content_id_uid', array('fid', 'content_type', 'content_id', 'uid'));
  }
  return $ret;
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.