diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-01-09 20:00:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 20:00:13 +0300 |
commit | 6b1e19337f00c3ac4a6e63aa063d6f8027e22d88 (patch) | |
tree | 5c970fe3c80672f2ed2bf00fc094ece88933c6aa | |
parent | 38a49cb8af1b35c7ac5d713e134cac72df9513f0 (diff) | |
parent | e003a77a371c1737b39da33b9bfd61292dfd4710 (diff) |
Merge pull request #13444 from nextcloud/backport/12969/stable15
[stable15] 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}}, |