function locale_update_7000

7.x locale.install locale_update_7000()

Add context field index and allow longer location.

Related topics

File

drupal-7.x/modules/locale/locale.install, line 37
Install, update and uninstall functions for the locale module.

Code

function locale_update_7000() {
  db_drop_index('locales_source', 'source');
  db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));

  // Also drop the 'textgroup_location' index added by the i18nstrings module
  // of the i18n project, which prevents the below schema update from running.
  if (db_index_exists('locales_source', 'textgroup_location')) {
    db_drop_index('locales_source', 'textgroup_location');
  }

  db_change_field('locales_source', 'location', 'location', array(
    'type' => 'text',
    'not null' => FALSE,
    'size' => 'big',
    'description' => 'Drupal path in case of online discovered translations or file path in case of imported strings.',
  ));
}