]> source.dussan.org Git - nextcloud-server.git/commitdiff
add support for boolean default 13445/head
authorMaxence Lange <maxence@artificial-owl.com>
Wed, 9 Jan 2019 09:51:31 +0000 (08:51 -0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Wed, 9 Jan 2019 13:02:06 +0000 (13:02 +0000)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
code cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
code cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php

index e4fb940bb2cbad7ab550b763e5adb9a8c1e998eb..4637c094ef80b8a028d59f952104210906e215f4 100644 (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}},