Repository navigation
[3.0] Compares the generation expression a column actually has - #9625
Merged
Sesquipedalian merged 1 commit intoSep 5, 2026
Merged
Sesquipedalian merged 1 commit into
Sesquipedalian merged 1 commit into
Conversation
normalize() decides whether a column needs changing by walking a list of properties and comparing what the schema asks for against what the database reports. One of the names in that list is generated_expression, which is not what either side calls it: the property on GeneratedColumn is generation_expression, and so is the key every database API puts in the structure it returns. It is the only place in the tree spelling it the other way. Both sides of the comparison therefore resolved to null through the null coalescing operators around them, null is never unequal to null, and the check could not fire. A column whose generation expression no longer matches the definition was reported as already correct. Nothing depends on it today, because these columns also differ in not_null and that catches them instead. It would matter the first time a 3.0.x changed the expression behind a generated column: fresh installs would build the new one, every existing forum would keep the old one, and the upgrade would report that it had nothing to do. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sesquipedalian
approved these changes
Sep 5, 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.
Description
normalize()decides whether a column needs changing by walking a list of properties and comparing what the schema asks for against what the database reports:One of those names is not what either side calls it. The property on
GeneratedColumnisgeneration_expression, and so is the key every database API puts in the structure it returns.Sources/Db/Schema/Table.php:240is the only place in the tree spelling it the other way:Both sides of that comparison therefore resolve to
nullthrough the null coalescing operators around them,nullis never unequal tonull, and the check cannot fire. A column whose generation expression no longer matches its definition is reported as already correct.Nothing depends on it today, because the generated columns on
messagesalso differ innot_nulland that catches them instead. It would matter the first time a 3.0.x changed the expression behind a generated column: fresh installs would build the new one, every existing forum would keep the old one, and the upgrade would report that it had nothing to do.How this was verified
This is latent rather than observable, so there is no before-and-after to show for the bug itself. What was checked is that correcting the name does not disturb what
normalize()already does: themodified_time,modified_nameandmodified_reasongenerated columns onmessagescome out the same on both engines, and a 2.1 → 3.0 upgrade followed by a second upgrade of the result changes nothing, on MySQL and on PostgreSQL, using.docker/rerun-upgrade.sh(#9622) against the 2.1.7 baseline from the 2.1 development environment.Not reachable from the unit suite
Schema\Column::__construct()callsDb::$db->calculate_type(), so the schema classes cannot be instantiated without a connection, andnormalize()does nothing but read and alter a live database.Issues References (Fixes|Related|Closes)