Skip to content

Issue/612 Accept the column type as text again - #642

Merged
armanist merged 1 commit into
quantum-php:3.1.xfrom
armanist:issue/612-column-type-text
Nov 2, 2026
Merged

armanist merged 1 commit into
quantum-php:3.1.xfrom
armanist:issue/612-column-type-text

Conversation

@armanist

@armanist armanist commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Refs #612. This pull request targets 3.1.x, so it does not close the issue; the merge of 3.1.x into master does.

What changed

  • Table::addColumn(), Table::modifyColumn() and Column::__construct() accept a Type case or the type as text again. A text type is used as before, in upper case, so any SQL type name works, including those that Type has no case for (integer, bigint, mediumtext).
  • Table::addIndex() and Table::setAction() stay enum-only.
  • The CHANGELOG.md entry 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 Type only. The quantum/project starter 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, so php qt migrate on a new project would throw a TypeError. 'integer' is not a Type value either (Type::INT is '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 BREAKING note for the other converted classes is unchanged.

Testing

  • The three tests that required a TypeError for a text type are replaced by accept-text tests. They fail before this change with the TypeError and pass after it:
    • BIGINT(20), INTEGER and MEDIUMTEXT in the generated CREATE TABLE
    • modifyColumn('name', 'varchar', 50) gives the same SQL as the enum
    • new Column(..., Type::VARCHAR) and new Column(..., 'varchar') have the same type

Notes for reviewers

  • Merge this before the merge of 3.1.x into master (Merge 3.1.x into master #641), so master never gets the strict version.
  • Nothing is released yet: the strict version exists only on 3.1.x and master.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@quantum-php quantum-php deleted a comment from coderabbitai Bot Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@armanist
armanist merged commit 1150347 into quantum-php:3.1.x Nov 2, 2026
6 checks passed
@armanist
armanist deleted the issue/612-column-type-text branch November 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants