diff -urp --strip-trailing-cr drupal-6-patched/modules/locale/locale.install drupal-6-mypatch/modules/locale/locale.install --- drupal-6-patched/modules/locale/locale.install 2007-08-26 02:47:20.000000000 +0200 +++ drupal-6-mypatch/modules/locale/locale.install 2007-08-26 03:52:27.000000000 +0200 @@ -75,19 +75,15 @@ function locale_update_6001() { } /** - * Add multiple text group support to allow for user defined string translation. + * Change locale column to language. The language column is added by + * update_fix_d6_requirements() in update.php to avoid a large number + * of error messages from update.php. All we need to do here is copy + * locale to language and then drop locale. */ function locale_update_6002() { $ret = array(); - switch ($GLOBALS['db_type']) { - case 'mysql': - case 'mysqli': - $ret[] = update_sql("ALTER TABLE {locales_source} ADD textgroup varchar(255) NOT NULL default 'default'"); - break; - case 'pgsql': - db_add_column($ret, 'locales_source', 'textgroup', 'varchar(255)', array('default' => "'default'", 'not null' => TRUE)); - break; - } + $ret[] = update_sql('UPDATE {locales_target} SET language = locale'); + db_drop_field($ret, 'locales_target', 'locale'); return $ret; } diff -urp --strip-trailing-cr drupal-6-patched/update.php drupal-6-mypatch/update.php --- drupal-6-patched/update.php 2007-08-26 02:47:20.000000000 +0200 +++ drupal-6-mypatch/update.php 2007-08-26 03:52:36.000000000 +0200 @@ -751,7 +751,9 @@ function update_fix_compatibility() { * Just adding columns is safe. However, renaming the * system.description column to owner is not. Therefore, we add the * system.owner column and leave it to system_update_6008() to copy - * the data from description and remove description. + * the data from description and remove description. The same for + * renaming locales_target.locale to locales_target.language, which + * will be finished by locale_update_6002(). */ function update_fix_d6_requirements() { $ret = array(); @@ -765,6 +767,12 @@ function update_fix_d6_requirements() { db_add_field($ret, 'system', 'info', array('type' => 'text')); db_add_field($ret, 'system', 'owner', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + if (db_table_exists('locales_target')) { + db_add_field($ret, 'locales_target', 'language', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '')); + } + if (db_table_exists('locales_source')) { + db_add_field($ret, 'locales_source', 'textgroup', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default')); + } variable_set('update_d6_requirements', TRUE); }