summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-10 19:58:21 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-10 19:58:21 +0000
commit7355739be1d5719601ac62cf9d1cb1df844e42a3 (patch)
treecb3f319f7d406bbeb2e8de12a746e36d11ecb164 /database
parent655289b8f98e65bd2a35eb78ab9c57e947d80a8d (diff)
downloadbrdo-7355739be1d5719601ac62cf9d1cb1df844e42a3.tar.gz
brdo-7355739be1d5719601ac62cf9d1cb1df844e42a3.tar.bz2
- Patch #21252 by baudolino: fixed upgrade path of locale_sources table change.
Diffstat (limited to 'database')
-rw-r--r--database/updates.inc20
1 files changed, 19 insertions, 1 deletions
diff --git a/database/updates.inc b/database/updates.inc
index 2ee4acf70..c14ca41e7 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -112,7 +112,8 @@ $sql_updates = array(
"2005-04-24" => "update_133",
"2005-04-30" => "update_134",
"2005-05-06" => "update_135",
- "2005-05-08" => "update_136"
+ "2005-05-08" => "update_136",
+ "2005-05-09" => "update_137"
);
function update_32() {
@@ -2456,6 +2457,23 @@ function update_136() {
return $ret;
}
+ function update_137() {
+ $ret = array();
+
+ if ($GLOBALS['db_type'] == 'mysql') {
+ $ret[] = update_sql("ALTER TABLE {locales_source} CHANGE location location varchar(255) NOT NULL default ''");
+ }
+ elseif ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql("ALTER TABLE {locales_source} RENAME location TO location_old");
+ $ret[] = update_sql("ALTER TABLE {locales_source} ADD location varchar(255)");
+ $ret[] = update_sql("ALTER TABLE {locales_source} ALTER location SET NOT NULL");
+ $ret[] = update_sql("ALTER TABLE {locales_source} ALTER location SET DEFAULT ''");
+ $ret[] = update_sql("UPDATE {locales_source} SET location = location_old");
+ $ret[] = update_sql("ALTER TABLE {locales_source} DROP location_old");
+ }
+ return $ret;
+}
+
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);