forked from doctrine/dbal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 3.9.x: fix doctrine#6198: stop considering generated column definition as being its default value (doctrine#6199) Fix condition on Ascii String for SQL Server (doctrine#6389) Add DBTypes that are missing for TypeMapping (doctrine#6463)
- Loading branch information
Showing
8 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Platforms; | ||
|
||
/** | ||
* Provides the behavior, features and SQL dialect of the PostgreSQL 12.0 database platform. | ||
*/ | ||
class PostgreSQL120Platform extends PostgreSQLPlatform | ||
{ | ||
public function getDefaultColumnValueSQLSnippet(): string | ||
{ | ||
// in case of GENERATED ALWAYS AS (foobar) STORED column (added in PostgreSQL 12.0) | ||
// PostgreSQL's pg_get_expr(adbin, adrelid) will return the 'foobar' part | ||
// which is not the 'default' value of the column but its 'definition' | ||
// so in that case we force it to NULL as DBAL will use that column only for the | ||
// 'default' value | ||
return <<<'SQL' | ||
SELECT | ||
CASE | ||
WHEN a.attgenerated = 's' THEN NULL | ||
ELSE pg_get_expr(adbin, adrelid) | ||
END | ||
FROM pg_attrdef | ||
WHERE c.oid = pg_attrdef.adrelid | ||
AND pg_attrdef.adnum=a.attnum | ||
SQL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters