mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 18:14:07 +02:00
SQLite: Fix expressions in default values (bug #860)
This commit is contained in:
@@ -294,10 +294,11 @@ function process_field($field, $type_field) {
|
||||
* @return string
|
||||
*/
|
||||
function default_value($field) {
|
||||
global $jush;
|
||||
$default = $field["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) : str_ireplace("current_timestamp()", "CURRENT_TIMESTAMP", $default))
|
||||
? q($default) : str_ireplace("current_timestamp()", "CURRENT_TIMESTAMP", ($jush == "sqlite" ? "($default)" : $default)))
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user