You are here

function comment_upload_update_3 in Comment Upload 6

Same name and namespace in other branches
  1. 5 comment_upload.install \comment_upload_update_3()

Update column cid to be an unsigned int (MySQL only). Add index on nid.

Implementation of hook_update_N().

File

./comment_upload.install, line 151
The install file that defines the tables in use by comment_upload.

Code

function comment_upload_update_3() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {comment_upload_files} CHANGE COLUMN cid cid int unsigned NOT NULL default '0'");
      $ret[] = update_sql("ALTER TABLE {comment_upload_files} ADD INDEX(nid)");
      break;
  }
  return $ret;
}