Skip to content

Commit

Permalink
Fix order of checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge authored Jan 10, 2022
1 parent b2535b1 commit 142a624
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Pgsql/PgsqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,17 @@ public function getTableColumns($table, $typeOnly = true)
{
if ($field->Default !== null)
{
// Change Postgresql's NULL::* type with PHP's null one
if (preg_match('/^NULL::*/', $field->Default))
{
$field->Default = null;
}

// Normalise default values like datetime
if (preg_match('/^\'(.*)\'::.*/', $field->Default, $matches))
{
$field->Default = $matches[1];
}

// Change Postgresql's NULL::* type with PHP's null one. Do this last to avoid PHP type issues in PHP 8.1 and up
if (preg_match('/^NULL::*/', $field->Default))
{
$field->Default = null;
}
}

// Do some dirty translation to MySQL output.
Expand Down

0 comments on commit 142a624

Please sign in to comment.