You are here

function path_redirect_update_4 in Path redirect 6

Same name and namespace in other branches
  1. 5 path_redirect.install \path_redirect_update_4()

Allow longer values for query strings fix the primary and unique keys.

File

./path_redirect.install, line 138
Install and uninstall schema and functions for the path_redirect module.

Code

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

  // Allow longer query strings.
  db_change_field($ret, 'path_redirect', 'query', 'query', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
  ));

  // Change the primary key from path to rid and add a unique key on path.
  db_drop_primary_key($ret, 'path_redirect');
  db_drop_unique_key($ret, 'path_redirect', 'rid');
  db_add_primary_key($ret, 'path_redirect', array(
    'rid',
  ));
  db_add_unique_key($ret, 'path_redirect', 'path', array(
    'path',
  ));
  return $ret;
}