[12.x] Improve Blueprint docblocks with concrete value ranges for integer and text columns #58019
+22
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Every time I create a migration, I get confused about the value ranges for different integer types. I have to remember or calculate what range a 1-byte, 2-byte, 3-byte, or 4-byte integer can hold. This mental overhead slows down development and can lead to choosing the wrong column type.
Changes
This PR enhances the docblocks for integer and text column methods in the
Blueprintclass to include:Integer Columns
tinyInteger(): -128 to 127 (signed) or 0 to 255 (unsigned)integer(): -2,147,483,648 to 2,147,483,647 (signed) or 0 to 4,294,967,295 (unsigned)bigInteger(): Full 64-bit ranges displayedText Columns
tinyText(): up to 255 characterstext(): up to 65,535 characters (~64 KB)mediumText(): up to 16,777,215 characters (~16 MB)longText(): up to 4,294,967,295 characters (~4 GB)Benefits
Example
Before:
After: