From 4f9a12a01d93bcffe3e4fecc23c53ff86d70dd43 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Mon, 23 Dec 2024 12:10:24 +0700 Subject: [PATCH] Update doc (#910) --- src/Schema/Column/ColumnBuilder.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Schema/Column/ColumnBuilder.php b/src/Schema/Column/ColumnBuilder.php index 8b35f3a2a..9602f673c 100644 --- a/src/Schema/Column/ColumnBuilder.php +++ b/src/Schema/Column/ColumnBuilder.php @@ -155,6 +155,20 @@ public static function string(int|null $size = 255): ColumnSchemaInterface /** * Builds a column with the abstract type `text`. + * + * @param int|null $size The maximum length of the column or `null` if it is not limited. + * + * MySQL creates the column as the smallest `TEXT` type large enough to hold values of `$size` characters. + * This corresponds to `TINYTEXT`, `MEDIUMTEXT`, `TEXT`, and `LONGTEXT` column types and depends on the character + * set used. + * + * For example, the maximum sizes in different character sets are as follows: + * | Column type | latin1 | utf8 | utf8mb4 + * |-------------|---------------|---------------|---------------- + * | TINYTEXT | 255 | 85 | 63 + * | TEXT | 65,535 | 21,845 | 16,383 + * | MEDIUMTEXT | 16,777,215 | 5,592,405 | 4,194,303 + * | LONGTEXT | 4,294,967,295 | 4,294,967,295 | 4,294,967,295 */ public static function text(int|null $size = null): ColumnSchemaInterface {