From 80027792007ba7d21a6f2e3b5846f8f15825d56a Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 9 Jan 2019 08:51:31 -0100 Subject: [PATCH] add support for boolean default Signed-off-by: Maxence Lange code cleaning Signed-off-by: Maxence Lange code cleaning Signed-off-by: Maxence Lange --- .../Command/Db/Migrations/GenerateFromSchemaFileCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php index e4fb940bb2..4637c094ef 100644 --- a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php +++ b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php @@ -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}},