From 8eb32c6f933f6919aae323953899e3f9d7a05887 Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Sun, 31 May 2026 11:31:51 +0530 Subject: [PATCH] fix(nhost): handle text column size correctly for varchar vs text types Previously text columns (unlimited length) fell through to 10485760 default, and character_octet_length (byte length) was used as a secondary fallback which can differ from character_maximum_length for multi-byte encodings. Now properly distinguishes text type columns and avoids using character_octet_length as a substitute for character_maximum_length. --- src/Migration/Sources/NHost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Migration/Sources/NHost.php b/src/Migration/Sources/NHost.php index 6c8fe0ac..908367b9 100644 --- a/src/Migration/Sources/NHost.php +++ b/src/Migration/Sources/NHost.php @@ -738,7 +738,7 @@ private function convertColumn(array $column, Table $table): Column required: $column['is_nullable'] === 'NO', default: $column['column_default'], array: $isArray, - size: $column['character_maximum_length'] ?? $column['character_octet_length'] ?? 10485760, + size: $column['character_maximum_length'] ?? ($column['data_type'] === 'text' ? 10485760 : ($column['character_octet_length'] ?? 10485760)), ); } }