You are here

function l10n_update_update_6002 in Localization update 6

Same name and namespace in other branches
  1. 7 l10n_update.install \l10n_update_update_6002()

Change status field name to l10n_status.

File

./l10n_update.install, line 253
Install file for l10n remote updates.

Code

function l10n_update_update_6002() {

  // I18n Strings module adds a 'status' column to 'locales_target' table.
  // L10n Update module previously added a column with the same name. To avoid
  // any collision we change the column name here, but only if it was added by
  // L10n Update module.
  $ret = array();
  if (!db_column_exists('locales_target', 'l10n_status') && db_column_exists('locales_target', 'status') && !db_table_exists('i18n_strings')) {
    db_change_field($ret, 'locales_target', 'status', 'l10n_status', array(
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ));
  }
  elseif (!db_column_exists('locales_target', 'l10n_status')) {
    db_add_field($ret, 'locales_target', 'l10n_status', array(
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ));
  }
  return $ret;
}