Index: database/database.pgsql =================================================================== RCS file: /cvs/drupal/drupal/database/database.pgsql,v retrieving revision 1.93 diff -u -r1.93 database.pgsql --- database/database.pgsql 16 Oct 2004 16:59:59 -0000 1.93 +++ database/database.pgsql 18 Oct 2004 16:01:50 -0000 @@ -307,7 +307,7 @@ CREATE TABLE locales_source ( lid serial, - location varchar(128) NOT NULL default '', + location text NOT NULL default '', source text NOT NULL, PRIMARY KEY (lid) ); Index: database/updates.inc =================================================================== RCS file: /cvs/drupal/drupal/database/updates.inc,v retrieving revision 1.65 diff -u -r1.65 updates.inc --- database/updates.inc 16 Oct 2004 16:59:59 -0000 1.65 +++ database/updates.inc 18 Oct 2004 16:02:08 -0000 @@ -84,7 +84,8 @@ "2004-09-14" => "update_105", "2004-09-15" => "update_106", "2004-09-17" => "update_107", - "2004-10-16" => "update_108" + "2004-10-16" => "update_108", + "2004-10-18" => "update_109" ); function update_32() { @@ -1882,6 +1883,7 @@ } function update_108() { + $ret = array(); // This update is needed for 4.5-RC sites, where profile data was not being // wiped from the user->data column correctly because update_80() was faulty. if (!variable_get('update_80_fix', false)) { @@ -1899,8 +1901,24 @@ user_save($user, $unset); } } + return $ret; +} + + +function update_109() { + $ret = array(); + // This is to fix the postgres locales_source schema. + if ($GLOBALS['db_type'] == 'pgsql') { + $ret[] = update_sql("ALTER TABLE {locales_source} RENAME location TO old_location"); + $ret[] = update_sql("ALTER TABLE {locales_source} ADD COLUMN location text"); + db_query("UPDATE {locales_source} SET location = old_location"); + $ret[] = update_sql("ALTER TABLE {locales_source} ALTER COLUMN location SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {locales_source} ALTER COLUMN location SET DEFAULT ''"); + } + return $ret; } + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql);