From 6ab3f791400a03c9283c663a1ecf0e3c28c0a78d Mon Sep 17 00:00:00 2001 From: albertlast Date: Sun, 6 Sep 2026 12:06:36 +0200 Subject: [PATCH] Lets table_sql read a column that has no default information_schema.columns.column_default is null for a column without one, and trim() has not taken null since PHP 8.1. The file declares strict_types, so the first such column ends the method rather than being passed over, and every table has one. Signed-off-by: albertlast --- Sources/Db/APIs/PostgreSQL.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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?