From 53dd5e0a9d7ec875d9d55bb528007cc6acb13f0b Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Wed, 15 Mar 2023 21:38:05 +0000 Subject: [PATCH] Fix set the default value on migration --- src/Database/Migration/SQLGenerator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Database/Migration/SQLGenerator.php b/src/Database/Migration/SQLGenerator.php index 4b8d1efa..0aee27ac 100644 --- a/src/Database/Migration/SQLGenerator.php +++ b/src/Database/Migration/SQLGenerator.php @@ -343,7 +343,10 @@ private function composeAddColumn(string $name, array $description): string } // Add default value - if ($default) { + if (!is_null($default)) { + if (is_bool($default)) { + $default = $default ? 'true' : 'false'; + } $type = sprintf('%s DEFAULT %s', $type, $default); }