File tree Expand file tree Collapse file tree 8 files changed +9
-9
lines changed
src/Tempest/Database/src/QueryStatements Expand file tree Collapse file tree 8 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function compile(DatabaseDialect $dialect): string
2121 return sprintf (
2222 '`%s` CHAR %s %s ' ,
2323 $ this ->name ,
24- $ this ->default ? "DEFAULT \"{$ this ->default }\"" : '' ,
24+ $ this ->default !== null ? "DEFAULT \"{$ this ->default }\"" : '' ,
2525 $ this ->nullable ? '' : 'NOT NULL ' ,
2626 );
2727 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function compile(DatabaseDialect $dialect): string
2121 return sprintf (
2222 '`%s` DATE %s %s ' ,
2323 $ this ->name ,
24- $ this ->default ? "DEFAULT \"{$ this ->default }\"" : '' ,
24+ $ this ->default !== null ? "DEFAULT \"{$ this ->default }\"" : '' ,
2525 $ this ->nullable ? '' : 'NOT NULL ' ,
2626 );
2727 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function compile(DatabaseDialect $dialect): string
2121 return sprintf (
2222 '`%s` DATETIME %s %s ' ,
2323 $ this ->name ,
24- $ this ->default ? "DEFAULT \"{$ this ->default }\"" : '' ,
24+ $ this ->default !== null ? "DEFAULT \"{$ this ->default }\"" : '' ,
2525 $ this ->nullable ? '' : 'NOT NULL ' ,
2626 );
2727 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function compile(DatabaseDialect $dialect): string
2121 return sprintf (
2222 '`%s` FLOAT %s %s ' ,
2323 $ this ->name ,
24- $ this ->default ? "DEFAULT {$ this ->default }" : '' ,
24+ $ this ->default !== null ? "DEFAULT {$ this ->default }" : '' ,
2525 $ this ->nullable ? '' : 'NOT NULL ' ,
2626 );
2727 }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function compile(DatabaseDialect $dialect): string
2323 '`%s` INTEGER %s %s %s ' ,
2424 $ this ->name ,
2525 $ this ->unsigned ? 'UNSIGNED ' : '' ,
26- $ this ->default ? "DEFAULT {$ this ->default }" : '' ,
26+ $ this ->default !== null ? "DEFAULT {$ this ->default }" : '' ,
2727 $ this ->nullable ? '' : 'NOT NULL ' ,
2828 );
2929 }
Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ public function compile(DatabaseDialect $dialect): string
3232 DatabaseDialect::SQLITE => sprintf (
3333 '`%s` TEXT %s %s ' ,
3434 $ this ->name ,
35- $ this ->default ? "DEFAULT ' {$ this ->default }' " : '' ,
35+ $ this ->default !== null ? "DEFAULT ' {$ this ->default }' " : '' ,
3636 $ this ->nullable ? '' : 'NOT NULL ' ,
3737 ),
3838 DatabaseDialect::POSTGRESQL => sprintf (
3939 '`%s` JSONB %s %s ' ,
4040 $ this ->name ,
41- $ this ->default ? "DEFAULT ( \"{$ this ->default }\") " : '' ,
41+ $ this ->default !== null ? "DEFAULT ( \"{$ this ->default }\") " : '' ,
4242 $ this ->nullable ? '' : 'NOT NULL ' ,
4343 ),
4444 };
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function compile(DatabaseDialect $dialect): string
2727 default => sprintf (
2828 '`%s` TEXT %s %s ' ,
2929 $ this ->name ,
30- $ this ->default ? "DEFAULT \"{$ this ->default }\"" : '' ,
30+ $ this ->default !== null ? "DEFAULT \"{$ this ->default }\"" : '' ,
3131 $ this ->nullable ? '' : 'NOT NULL ' ,
3232 ),
3333 };
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function compile(DatabaseDialect $dialect): string
2323 '`%s` VARCHAR(%s) %s %s ' ,
2424 $ this ->name ,
2525 $ this ->size ,
26- $ this ->default ? "DEFAULT \"{$ this ->default }\"" : '' ,
26+ $ this ->default !== null ? "DEFAULT \"{$ this ->default }\"" : '' ,
2727 $ this ->nullable ? '' : 'NOT NULL ' ,
2828 );
2929 }
You can’t perform that action at this time.
0 commit comments