This has nothing to do with Laravel migrations, but rather the data type of the table column, which depends on the size of the text string.
TINYTEXT: 255 characters - 255 B
TINYTEXTThe data object is the smallest of theTEXTseries and is designed to efficiently store short message strings. This type can store up to 255 bytes (expressed as 2^8 -1) or 255 characters and requires 1 byte of overhead. This object can be used to store things like short snippets, URL links, and other shorter objects.TINYTEXTis preferred overVARCHARwhen storing data that is less than 255 characters long and is not of consistent length and does not need to be used for sorting criteria.
Text: 65,535 characters - 64 KB
The standardTEXTdata object is sufficient to handle typical long-form text content.TEXTThe maximum size of a data object is 64 KB (expressed as 2^16 -1) or 65,535 characters, requiring 2 bytes of overhead. It's large enough to hold text like an article, but not large enough to hold the text of an entire book.
MEDIUMTEXT: 16,777,215 characters - 16 MB
MEDIUMTEXTData objects are useful for storing larger text strings such as white papers, books, and code backups. These data objects can be as large as 16 MB (expressed as 2^24 -1) or 16,777,215 characters, and require 3 bytes of overhead storage.
Long text: 4,294,967,295 characters - 4 GB
LONGTEXTData object is used for extreme text string storage use cases. This is a viable option when the MEDIUMTEXT object is not large enough. Computer programs and applications often achieve text lengths in theLONGTEXTrange. These data objects can be up to 4 GB in size (expressed as 2^32 -1), store up to 4,294,967,295 characters, and require 4 bytes of overhead storage
Please note that the number of characters that can be stored in a column depends on the character encoding.
This has nothing to do with Laravel migrations, but rather the data type of the table column, which depends on the size of the text string.
TINYTEXT: 255 characters - 255 B
TINYTEXT
The data object is the smallest of theTEXT
series and is designed to efficiently store short message strings. This type can store up to 255 bytes (expressed as 2^8 -1) or 255 characters and requires 1 byte of overhead. This object can be used to store things like short snippets, URL links, and other shorter objects.TINYTEXT
is preferred overVARCHAR
when storing data that is less than 255 characters long and is not of consistent length and does not need to be used for sorting criteria.Text: 65,535 characters - 64 KB
The standard
TEXT
data object is sufficient to handle typical long-form text content.TEXT
The maximum size of a data object is 64 KB (expressed as 2^16 -1) or 65,535 characters, requiring 2 bytes of overhead. It's large enough to hold text like an article, but not large enough to hold the text of an entire book.MEDIUMTEXT: 16,777,215 characters - 16 MB
MEDIUMTEXT
Data objects are useful for storing larger text strings such as white papers, books, and code backups. These data objects can be as large as 16 MB (expressed as 2^24 -1) or 16,777,215 characters, and require 3 bytes of overhead storage.Long text: 4,294,967,295 characters - 4 GB
LONGTEXT
Data object is used for extreme text string storage use cases. This is a viable option when the MEDIUMTEXT object is not large enough. Computer programs and applications often achieve text lengths in theLONGTEXT
range. These data objects can be up to 4 GB in size (expressed as 2^32 -1), store up to 4,294,967,295 characters, and require 4 bytes of overhead storagePlease note that the number of characters that can be stored in a column depends on the character encoding.
Text can handle up to 65,535 characters
Long text can handle up to 4,294,967,295 characters