Thanks to GottfriedCP (https://github.com/adminerevo/adminerevo/issues/157)
*/
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));
+ return ($default === null ? "" : " DEFAULT " .
+ (!preg_match('~^GENERATED ~i', $default) && (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default))
+ ? q($default) : $default)
+ );
}
/** Get type class to use in CSS