diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2019-01-09 14:00:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 14:00:07 +0100 |
commit | b8bb1d491f79c97addf800730122a1702762f046 (patch) | |
tree | 56996ed73ade265a372fe204e768d123ca687c7a | |
parent | 6e3b9ee75c02c40aed812002d9c8d1d97c6db656 (diff) | |
parent | 80027792007ba7d21a6f2e3b5846f8f15825d56a (diff) | |
download | nextcloud-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.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}}, |