You are here

function linkchecker_update_6204 in Link checker 6.2

Make fields unsigned.

File

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

Code

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

  // Make linkchecker_links.lid unsigned.
  db_change_field($ret, 'linkchecker_links', 'lid', 'lid', array(
    'type' => 'serial',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  if ($GLOBALS['db_type'] == 'pgsql') {
    db_add_primary_key($ret, 'linkchecker_links', array(
      'lid',
    ));
  }

  // Make linkchecker_boxes.bid and linkchecker_boxes.lid unsigned.
  db_drop_primary_key($ret, 'linkchecker_boxes');
  db_change_field($ret, 'linkchecker_boxes', 'bid', 'bid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_change_field($ret, 'linkchecker_boxes', 'lid', 'lid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_add_primary_key($ret, 'linkchecker_boxes', array(
    'bid',
    'lid',
  ));

  // Make linkchecker_comments.cid and linkchecker_comments.lid unsigned.
  db_drop_primary_key($ret, 'linkchecker_comments');
  db_change_field($ret, 'linkchecker_comments', 'cid', 'cid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_change_field($ret, 'linkchecker_comments', 'lid', 'lid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_add_primary_key($ret, 'linkchecker_comments', array(
    'cid',
    'lid',
  ));

  // Make linkchecker_nodes.nid and linkchecker_nodes.lid unsigned.
  db_drop_primary_key($ret, 'linkchecker_nodes');
  db_change_field($ret, 'linkchecker_nodes', 'nid', 'nid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_change_field($ret, 'linkchecker_nodes', 'lid', 'lid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));
  db_add_primary_key($ret, 'linkchecker_nodes', array(
    'nid',
    'lid',
  ));
  return $ret;
}