You are here

function linkchecker_update_5204 in Link checker 5.2

Make fields unsigned.

File

./linkchecker.install, line 339
Installation file for Link Checker module.

Code

function linkchecker_update_5204() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {linkchecker_links} CHANGE lid `lid` INT unsigned NOT NULL auto_increment");
      $ret[] = update_sql("ALTER TABLE {linkchecker_boxes} DROP PRIMARY KEY");
      $ret[] = update_sql("ALTER TABLE {linkchecker_boxes} CHANGE bid `bid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_boxes} CHANGE lid `lid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_boxes} ADD PRIMARY KEY (bid, lid)");
      $ret[] = update_sql("ALTER TABLE {linkchecker_comments} DROP PRIMARY KEY");
      $ret[] = update_sql("ALTER TABLE {linkchecker_comments} CHANGE cid `cid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_comments} CHANGE lid `lid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_comments} ADD PRIMARY KEY (cid, lid)");
      $ret[] = update_sql("ALTER TABLE {linkchecker_nodes} DROP PRIMARY KEY");
      $ret[] = update_sql("ALTER TABLE {linkchecker_nodes} CHANGE nid `nid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_nodes} CHANGE lid `lid` INT unsigned NOT NULL");
      $ret[] = update_sql("ALTER TABLE {linkchecker_nodes} ADD PRIMARY KEY (nid, lid)");
      break;
  }
  return $ret;
}