Merge pull request #13444 from nextcloud/backport/12969/stable15

[stable15] add support for boolean default
This commit is contained in:
Morris Jobke 2019-01-09 18:00:13 +01:00 committed by GitHub
commit 6b1e19337f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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}},