#110423ALTER TABLE ADD COLUMN fails on SQLite for json and uuid columns
Description
Adding a column whose doctrine type needs a type hint comment of the form (DC2Type:json) or (DC2Type:uuid) to an existing table fails:
SQLSTATE[HY000]: General error: 1 error in table a_test_table
after add column: incomplete input
SQLite renders column comments as double dash line comments. In the simplified single action form ALTER TABLE the_table ADD COLUMN the_definition everything behind the double dash is commented out, so the statement ends up incomplete.
This hits real upgrades: the same fields are generated from TCA by DefaultTcaSchema, so an instance upgrading to a version that introduces a JSON or UUID column cannot complete its database compare on SQLite. That makes it an upgrade blocker rather than an edge case.
doctrine/dbal guards against this – getSimpleAlterTableSQL() falls back to the table rebuild as soon as a column carries a comment. TYPO3 never reaches that guard, because the type hint is appended inside getColumnDeclarationSQL(), which runs after the check; the column itself still has an empty comment at that point.
Fix
Remove the need for the hint instead of adding it earlier. SQLite is dynamically typed and reports the declared column type verbatim through pragma_table_info, so dedicated JSON and UUID declarations are used and mapped back on introspection. No comment is written on SQLite anymore, and the failing statement form is never generated. Removing the type comment for SQLite from the platform trait is part of the fix, not a follow-up cleanup: with the trait still applied the hint is appended regardless of the declaration.
Existing installations are unaffected. Columns created before this carry CLOB or CHAR(36) plus the type comment and resolve to the same doctrine type on introspection, and schema comparison uses the generated column declaration rather than the stored database type, so no change is detected. A functional test covers that.
Reproducer adopted from Gerrit 93631.
Patch
Gerrit 95188, topic database-analyzer.
Releases: main, 14.3, 13.4