mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 16:17:48 +02:00
PostgreSQL: Allow now() as default value (bug #525)
This commit is contained in:
@@ -199,7 +199,7 @@ function process_field($field, $type_field) {
|
||||
process_type($type_field),
|
||||
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
|
||||
(isset($default) ? " DEFAULT " . (
|
||||
(preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP(\(\))?$~i', $default))
|
||||
(preg_match('~time~', $field["type"]) && preg_match('~^(now\(\)|CURRENT_TIMESTAMP(\(\)))?$~i', $default))
|
||||
|| ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default))
|
||||
|| ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default))
|
||||
|| ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default))
|
||||
|
Reference in New Issue
Block a user