summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/update.php b/update.php
index 457593339..1db7779a6 100644
--- a/update.php
+++ b/update.php
@@ -125,8 +125,12 @@ function db_change_column(&$ret, $table, $column, $column_new, $type, $attribute
$ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old");
$ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column_new $type");
$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"); }
+ 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");
+ }
$ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old");
}