User tests: Successful: Unsuccessful:
Pull Request resolves #48167 .
ChangeSet now tracks, per changed column or index, whether a later SQL update file changes the same schema object. Change items whose target has been redefined by a later file are flagged with a new ChangeItem::$superseded property.
ChangeSet::check() and ChangeSet::getStatus() no longer report a -2 (check failed) result as an error when the corresponding item is superseded — it is treated as skipped instead. This lets extensions keep a full history of incremental schema changes across versions (e.g. a column added in one release and altered in a later one) without Joomla reporting a false database error when the database already matches the latest definition, just not the older, superseded one.
ChangeItem::$queryType docblock also updated to list the current, complete set of supported query types (ADD_COLUMN, ADD_INDEX, CHANGE_COLUMN_TYPE, CREATE_TABLE, DROP_COLUMN, DROP_INDEX, RENAME_TABLE), replacing the outdated ADD_TABLE reference.
Only column-level (ADD_COLUMN, DROP_COLUMN, CHANGE_COLUMN_TYPE) and index-level (ADD_INDEX, DROP_INDEX) change items can be superseded, keyed by table + column/index name. CREATE_TABLE and RENAME_TABLE items are never superseded.
ChangeSet::check()/getStatus() for the extension).Extensions whose SQL update files change the same column or index more than once across versions (e.g. add a column, then later change its type) are reported as having database errors, even though the database schema fully matches the extension's latest intended definition. The obsolete, superseded expectation from the earlier update file is still checked and fails.
Change items superseded by a later update to the same column or index are no longer reported as errors (they are reported as skipped instead), while still being re-run by fix() when needed as an intermediate step. Only the current, non-superseded expectations are treated as errors when they fail.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
If accepted, this PR must be backport to 5.4-dev and forward-port to 6.2-dev. It is easy. The files seem identical in all three branches.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-6.1-dev
|
||
If accepted, this PR must be backport to 5.4-dev and forward-port to 6.2-dev. It is easy. The files seem identical in all three branches.
@leeroy1821 That's not really the right way.
If it is really a bug fix, it should be made for the 5.4-dev branch, and release managers will later merge it up into the other branches.
But if it is considered a new feature, it should be made for the 6.2-dev branch.
PPs for the 6.1-dev branch should only be made for 6.x specific bugs which do not exist in 5.4 and should be fixed with the next 6.1.x patch release.
See also https://github.com/joomla/joomla-cms#which-branch-should-my-pull-request-target and https://github.com/joomla/joomla-cms?tab=contributing-ov-file .
In my humble opinion it can be considered a new feature.
It tries to fix a long standing limitation of the database checker and fixer for which there are ways to deal with (the core does that), see my comment in the issue: #48167 (comment)
I've asked other maintainers, maybe there are different opinions.
Besides this, I think the fix is incomplete.
For example it does not consider that a later DROP TABLE statement will superseed all previous ALTER TABLE statements or index modifications for that table.
The pull request introduces a new mechanism for identifying and skipping superseded database schema changes. Since this addresses a long-standing limitation rather than a regression introduced in Joomla 6.1, I would classify it as an enhancement rather than a patch-level bug fix.
It also appears that the implementation does not yet cover all superseding operations, such as a later DROP TABLE superseding previous column and index changes. See comment from @richard67
Please retarget this to 6.2-dev.
@leeroy1821 That's not really the right way.
If it is really a bug fix, it should be made for the 5.4-dev branch, and release managers will later merge it up into the other branches.
But if it is considered a new feature, it should be made for the 6.2-dev branch.
PPs for the 6.1-dev branch should only be made for 6.x specific bugs which do not exist in 5.4 and should be fixed with the next 6.1.x patch release.
See also #48176 and https://github.com/joomla/joomla-cms?tab=contributing-ov-file .
In my humble opinion it can be considered a new feature.
It tries to fix a long standing limitation of the database checker and fixer for which there are ways to deal with (the core does that), see my comment in the issue: #48167 (comment)
I've asked other maintainers, maybe there are different opinions.
Besides this, I think the fix is incomplete.
For example it does not consider that a later
DROP TABLEstatement will superseed all previousALTER TABLEstatements or index modifications for that table.