You are here

function i18n_update_1 in Internationalization 5.3

Same name and namespace in other branches
  1. 5 i18n.install \i18n_update_1()
  2. 5.2 i18n.install \i18n_update_1()

Drupal 4.7 updates

File

./i18n.install, line 83

Code

function i18n_update_1() {
  $items = array();
  $items[] = update_sql("ALTER TABLE {i18n_node} ADD language VARCHAR(12)");
  $items[] = update_sql("UPDATE {i18n_node} i INNER JOIN {node} n ON i.nid = n.nid SET i.language = n.language ");
  $items[] = update_sql("INSERT INTO {i18n_node}(nid,language) SELECT n.nid, n.language FROM {node} n LEFT JOIN {i18n_node} i ON n.nid = i.nid WHERE n.language != '' AND i.nid IS NULL");
  return $items;
}