add support for boolean default

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
code cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
code cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2019-01-09 08:51:31 -01:00 committed by Joas Schilling
parent 8593edd66d
commit 8002779200
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 5 additions and 1 deletions

View File

@ -127,7 +127,11 @@ EOT
}
$default = $column->getDefault();
if ($default !== null) {
$default = is_numeric($default) ? $default : "'$default'";
if (is_string($default)) {
$default = "'$default'";
} else if (is_bool($default)) {
$default = ($default === true) ? 'true' : 'false';
}
$content .= str_replace('{{default}}', $default, <<<'EOT'
'default' => {{default}},