Skip to content

Commit

Permalink
当数据表中含 DEFAULT NULL 时,导致其丢失的问题
Browse files Browse the repository at this point in the history
Signed-off-by: e282486518 <phphome@qq.com>
  • Loading branch information
e282486518 committed Jul 11, 2019
1 parent d904e7d commit 0d447cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/MigrateCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ public function getTableField($column){
$fields .= " DEFAULT {$column->defaultValue}";
} elseif (is_int($column->defaultValue) || !empty($column->defaultValue) || $column->defaultValue == '') {
$fields .= " DEFAULT '{$column->defaultValue}'";
} elseif (is_null($column->defaultValue)) {
$fields .= " DEFAULT NULL";
}

/* 备注 */
Expand Down

0 comments on commit 0d447cb

Please sign in to comment.