summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-12-07 20:59:34 +0000
committerDries Buytaert <dries@buytaert.net>2005-12-07 20:59:34 +0000
commitbb1f5dfdac17c4654e2a75abc22472779794a789 (patch)
tree2aae7887eb3a511ae7ff400a340f0660d44c964d /update.php
parent94d6b9abf046278d87640eadce2fa45591968778 (diff)
downloadbrdo-bb1f5dfdac17c4654e2a75abc22472779794a789.tar.gz
brdo-bb1f5dfdac17c4654e2a75abc22472779794a789.tar.bz2
- Patch #40303 by Cvbge: drop old columns for PostgreSQL and fixed some PostgreSQL problems in the update script.
Diffstat (limited to 'update.php')
-rw-r--r--update.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/update.php b/update.php
index a76587ce7..b3a79a844 100644
--- a/update.php
+++ b/update.php
@@ -136,8 +136,7 @@ function db_change_column(&$ret, $table, $column, $column_new, $type, $attribute
$ret[] = update_sql("UPDATE {". $table ."} SET $column_new = ". $column ."_old");
if ($default) { $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET $default"); }
if ($not_null) { $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET NOT NULL"); }
- // We don't drop columns for now
- // $ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old");
+ $ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old");
}
/**
@@ -196,7 +195,7 @@ function update_fix_schema_version() {
switch ($GLOBALS['db_type']) {
case 'pgsql':
$ret = array();
- db_add_column($ret, 'system', 'schema_version', 'int2', array('not null' => TRUE));
+ db_add_column($ret, 'system', 'schema_version', 'smallint', array('not null' => TRUE, 'default' => 1));
break;
case 'mysql':
@@ -244,11 +243,12 @@ function update_fix_watchdog() {
if (update_get_installed_version('system') < 142 && !variable_get('update_watchdog_fixed', FALSE)) {
switch ($GLOBALS['db_type']) {
case 'pgsql':
+ $ret = array();
db_add_column($ret, 'watchdog', 'referer', 'varchar(128)', array('not null' => TRUE, 'default' => "''"));
break;
case 'mysql':
case 'mysqli':
- $ret[] = db_query("ALTER TABLE {watchdog} ADD COLUMN referer varchar(128) NOT NULL");
+ db_query("ALTER TABLE {watchdog} ADD COLUMN referer varchar(128) NOT NULL");
break;
}