diff --git a/inc/migration.class.php b/inc/migration.class.php index 81d9619c405..bc062fce5af 100644 --- a/inc/migration.class.php +++ b/inc/migration.class.php @@ -331,13 +331,13 @@ function addField($table, $field, $type, $options=array()) { $format = $this->fieldFormat($type, $params['value'], $params['nodefault']); - if ($params['comment']) { + if (!empty($params['comment'])) { $params['comment'] = " COMMENT '".addslashes($params['comment'])."'"; } - if ($params['after']) { + if (!empty($params['after'])) { $params['after'] = " AFTER `".$params['after']."`"; - } else if (isset($params['first'])) { + } else if (!empty($params['first'])) { $params['first'] = " FIRST "; } @@ -346,7 +346,7 @@ function addField($table, $field, $type, $options=array()) { $this->change[$table][] = "ADD `$field` $format ".$params['comment'] ." ". $params['first'].$params['after'].""; - if (isset($params['update']) && strlen($params['update'])) { + if (!empty($params['update'])) { $this->migrationOneTable($table); $query = "UPDATE `$table` SET `$field` = ".$params['update']." ".