#128866 by JirkaRybka: fix broken update path of locale tables on PostgreSQL

6.x
Gábor Hojtsy 2007-11-15 13:27:45 +00:00
parent 940b059010
commit d8c18ac010
1 changed files with 18 additions and 1 deletions

View File

@ -110,7 +110,24 @@ function locale_update_6004() {
*/
function locale_update_6005() {
$ret = array();
$ret[] = update_sql("DELETE s FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid WHERE t.lid IS NULL");
$ret[] = update_sql("DELETE FROM {locales_source} WHERE lid NOT IN (SELECT lid FROM {locales_target})");
return $ret;
}
/**
* Fix remaining inconsistent indexes.
*/
function locale_update_6006() {
$ret = array();
db_add_index($ret, 'locales_target', 'language', array('language'));
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_drop_index($ret, 'locales_source', 'source');
db_add_index($ret, 'locales_source', 'source', array(array('source', 30)));
break;
}
return $ret;
}