#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
Reviews 3
History 110
-
Gerrit Code Review pushed patch set 3 for main to change 95188 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-11T04:00:57+00:00" > 08/11/26, 04:00 </span> -
Gerrit Code Review pushed patch set 4 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-11T05:17:36+00:00" > 08/11/26, 05:17 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-11T11:38:28+00:00" > 08/11/26, 11:38 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-11T13:29:35+00:00" > 08/11/26, 13:29 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-11T14:14:16+00:00" > 08/11/26, 14:14 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-14T20:48:58+00:00" > 08/14/26, 20:48 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 95188 <span data-processor="relativetime" data-value="2026-08-31T10:29:04+00:00" > 08/31/26, 10:29 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95553 <span data-processor="relativetime" data-value="2026-09-02T09:49:53+00:00" > 09/02/26, 09:49 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 95554 <span data-processor="relativetime" data-value="2026-09-02T09:50:00+00:00" > 09/02/26, 09:50 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-02T10:30:10+00:00" > 09/02/26, 10:30 </span>
Applied in changeset commit:cc69a31d0e34a0282067153c53d83dd6685ee074.