Merge pull request #12969 from nextcloud/db-migration-boolean-default

add support for boolean default
This commit is contained in:
Joas Schilling 2019-01-09 14:00:07 +01:00 committed by GitHub
commit b8bb1d491f
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}},