diff --git a/Sources/Db/APIs/PostgreSQL.php b/Sources/Db/APIs/PostgreSQL.php index e3c39760ab..77839d71d1 100644 --- a/Sources/Db/APIs/PostgreSQL.php +++ b/Sources/Db/APIs/PostgreSQL.php @@ -1101,8 +1101,8 @@ public function table_sql(string $table_name): string // Make the CREATE for this column. $schema_create .= ' "' . $row['column_name'] . '" ' . $row['data_type'] . ($row['is_nullable'] != 'YES' ? ' NOT NULL' : ''); - // Add a default...? - if (trim($row['column_default']) != '') { + // Add a default...? A column without one reads as null here. + if (trim($row['column_default'] ?? '') != '') { $schema_create .= ' default ' . $row['column_default'] . ''; // Auto increment?