aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2019-01-09 14:00:07 +0100
committerGitHub <noreply@github.com>2019-01-09 14:00:07 +0100
commitb8bb1d491f79c97addf800730122a1702762f046 (patch)
tree56996ed73ade265a372fe204e768d123ca687c7a
parent6e3b9ee75c02c40aed812002d9c8d1d97c6db656 (diff)
parent80027792007ba7d21a6f2e3b5846f8f15825d56a (diff)
downloadnextcloud-server-b8bb1d491f79c97addf800730122a1702762f046.tar.gz
nextcloud-server-b8bb1d491f79c97addf800730122a1702762f046.zip
Merge pull request #12969 from nextcloud/db-migration-boolean-default
add support for boolean default
-rw-r--r--core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php6
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}},