Empty value drops DEFAULT
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@340 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
a2a318b1c8
commit
35cc8e898c
|
@ -21,7 +21,7 @@ if ($_POST && !$error) {
|
|||
} elseif ($field["type"] == "timestamp") {
|
||||
$set[] = " MODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val" . ($_POST["on_update"][bracket_escape($name)] ? " ON UPDATE CURRENT_TIMESTAMP" : "");
|
||||
} else {
|
||||
$set[] = " ALTER " . idf_escape($name) . ($val == "NULL" ? " DROP DEFAULT" : " SET DEFAULT $val");
|
||||
$set[] = " ALTER " . idf_escape($name) . ($val == ($field["null"] ? "NULL" : "''") ? " DROP DEFAULT" : " SET DEFAULT $val");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue