[2.x] [Tags] Drop legacy unused background columns from tags table#4529
[2.x] [Tags] Drop legacy unused background columns from tags table#4529Abdooo2235 wants to merge 1 commit intoflarum:2.xfrom
Conversation
DavideIadeluca
left a comment
There was a problem hiding this comment.
Thanks for picking up the issue I opened. Have you considered using Flarum’s migration helper? The migration in the PR feels a bit more complex than necessary and could likely be simplified along these lines:
use Flarum\Database\Migration;
return Migration::dropColumns('tags', [
'background_path' => [..],
'background_mode' => [..],
]);Note that with Migration::dropColumns() you still need to specify the column constraints and metadata, similar to what you would define in the up migration.
Another thing that stood out in the PR is that the attributes are still present. If background_mode and background_path are no longer required, wouldn’t this effectively become dead code? It might be better to remove them entirely and go for a clean break.
Since Flarum 2 hasn’t been tagged as stable yet, a breaking change like this should still be acceptable without creating backwards compatibility concerns.
Summary
This PR removes two legacy columns from the
tagstable that are no longer used by current tags flows:background_pathbackground_modeFixes #4527.
What changed
downlogic to restore the columns if needed.backgroundUrlandbackgroundModeattributes, now read via generic model attributes.Backward compatibility
hasTableandhasColumnto be safe for varied install states.Scope note
An unrelated local change in
extensions/tags/js/tsconfig.jsonwas intentionally excluded from this PR to keep the fix focused.Testing
extensions/tags/tests/integration/api/tags/SchemaTest.phpphpunitis not available (sh: 1: phpunit: not found).