Repository navigation
Issue/612 Accept the column type as text again - #642
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
andrey-smaelov
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #612. This pull request targets
3.1.x, so it does not close the issue; the merge of3.1.xintomasterdoes.What changed
Table::addColumn(),Table::modifyColumn()andColumn::__construct()accept aTypecase or the type as text again. A text type is used as before, in upper case, so any SQL type name works, including those thatTypehas no case for (integer,bigint,mediumtext).Table::addIndex()andTable::setAction()stay enum-only.CHANGELOG.mdentry of Convert the first batch of Enums classes to PHP enums #612 is corrected to match.Why
The enum conversion in #640 made these three methods take
Typeonly. Thequantum/projectstarter migrations write the column type as text (addColumn('id', 'integer'),'char','varchar','text','timestamp', 31 calls in 3 files), and the migration pages of the documentation show the same, sophp qt migrateon a new project would throw aTypeError.'integer'is not aTypevalue either (Type::INTis'int'), and the enum has only 17 types, while the column type used to be any SQL type name.Breaking changes
None compared to 3.1.0: the behavior of these three methods is the same as before #640. The
BREAKINGnote for the other converted classes is unchanged.Testing
TypeErrorfor a text type are replaced by accept-text tests. They fail before this change with theTypeErrorand pass after it:BIGINT(20),INTEGERandMEDIUMTEXTin the generatedCREATE TABLEmodifyColumn('name', 'varchar', 50)gives the same SQL as the enumnew Column(..., Type::VARCHAR)andnew Column(..., 'varchar')have the same typeNotes for reviewers
3.1.xintomaster(Merge 3.1.x into master #641), somasternever gets the strict version.3.1.xandmaster.