diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 4232eec2..a19b83fb 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -238,7 +238,15 @@ function process_field($field, $type_field) { */ function default_value($field) { $default = $field["default"]; - return ($default === null ? "" : " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default) ? q($default) : $default)); + if ($default === null) return ""; + + if (preg_match('~^GENERATED ~i', $default)) { + return " $default"; + } + + $quote = preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default); + + return " DEFAULT " . ($quote ? q($default) : $default); } /** Get type class to use in CSS