1.20.x redirect.install redirect_update_1001()

Rename the language column to langcode.

File

modules/redirect/redirect.install, line 135
Install, update and uninstall functions for the Redirect module.

Code

function redirect_update_1001() {
  if (db_index_exists('redirect', 'source_language')) {
    db_drop_index('redirect', 'source_language');
  }
  if (db_field_exists('redirect', 'language')) {
    $spec = array(
      'description' => 'The language this redirect is for; if blank, the alias will be used for unknown languages.',
      'type' => 'varchar',
      'length' => 12,
      'not null' => TRUE,
      'default' => 'und',
    );
    db_change_field('redirect', 'language', 'langcode', $spec);
    db_add_index('redirect', 'source_langcode', array('source', 'langcode'));
  }
}