diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-01-09 08:51:31 -0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-01-09 11:21:14 +0100 |
commit | 80027792007ba7d21a6f2e3b5846f8f15825d56a (patch) | |
tree | 4a7da9108dbee7fd0112d746b02ad238e9cf5f5f /core/Command | |
parent | 8593edd66d31e5121b3f770853dcc9256c0bc42a (diff) | |
download | nextcloud-server-80027792007ba7d21a6f2e3b5846f8f15825d56a.tar.gz nextcloud-server-80027792007ba7d21a6f2e3b5846f8f15825d56a.zip |
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>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php index e4fb940bb2c..4637c094ef8 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}}, |