Skip to content

docs: stop recommending updateDestructive for plugins - #2426

Open
Soner (shyim) wants to merge 1 commit into
mainfrom
docs/plugin-update-destructive-guidance
Open

docs: stop recommending updateDestructive for plugins#2426
Soner (shyim) wants to merge 1 commit into
mainfrom
docs/plugin-update-destructive-guidance

Conversation

@shyim

@shyim Soner (shyim) commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Align plugin migration docs with Shopware core behavior: plugin install and update only run update(), never updateDestructive().
  • Advise plugin authors to put all needed schema/data changes in update() and clean up in uninstall(); treat updateDestructive() as core-only and not useful for plugins.
  • Remove empty updateDestructive() stubs from plugin guide examples, drop database:migrate-destructive / manual destructive examples from the plugin migration guide, and simplify the related migration unit test sample.

Related links

  • Validated against shopware/shopware trunk (MigrationStep, MigrationRuntime, PluginLifecycleService::runMigrations()).

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted.
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms.
  • Any required dependent changes in downstream modules have already been merged and published.
  • This pull request is ready for review.

Notes

  • Core coding guideline resources/guidelines/code/core/database-migations.md was left unchanged (synced from core; still correct for platform migrations).
  • Redirects and wordlist: no pages moved/renamed; no new terms introduced.
  • Draft until review; checklist item for ready-for-review left unchecked on purpose.

Plugin install/update only run update(), so document that path and
drop empty updateDestructive stubs from plugin migration examples.
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Aug 6, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 2561f21
Preview: https://developer-documentation-8rll1v988-shopware-frontends.vercel.app
Workflow run: #4716

@shyim
Soner (shyim) marked this pull request as ready for review August 6, 2026 04:46
Copilot AI lite review requested due to automatic review settings August 6, 2026 04:46
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📊 Documentation Impact Analyzer

Metric Result
Score 58
Recommendation ✅ Highly meaningful
Categories Framework, Plugins

Reasons

  • +3: PR title contains "plugin"
  • +4: Framework
  • +3: Plugin Development
  • +3: Plugin Development
  • +3: Plugin Development
  • +3: Plugin Development
  • +3: Plugin Development
  • +3: Plugin Development
  • +2: Code examples
  • +3: Plugin Development
  • +4: Framework
  • +3: Plugin Development
  • +4: Framework
  • +3: Plugin Development
  • +4: Framework
  • +3: Plugin Development
  • +4: Framework
  • +3: Plugin Development

This score is automatically generated based on documentation impact heuristics.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Shopware plugin documentation to reflect current core behavior: plugin install/update runs migration update() only, and updateDestructive() should not be recommended for plugin development.

Changes:

  • Removed empty updateDestructive() stubs across multiple plugin migration code examples.
  • Reworked the plugin database migration guide to focus on update() and removed destructive/database:migrate-destructive guidance for plugins.
  • Adjusted related conceptual and unit test documentation to match the updated migration workflow.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
guides/plugins/plugins/storefront/howto/add-custom-sorting-product-listing.md Removes unused updateDestructive() stub from migration example.
guides/plugins/plugins/framework/data-handling/field-inheritance.md Removes unused updateDestructive() stub(s) and cleans up the migration example blocks.
guides/plugins/plugins/framework/data-handling/add-data-translations.md Removes unused updateDestructive() stub from migration example.
guides/plugins/plugins/framework/data-handling/add-custom-complex-data.md Removes unused updateDestructive() stub from migration example.
guides/plugins/plugins/framework/data-handling/add-complex-data-to-existing-entities.md Removes unused updateDestructive() stub from migration example.
guides/plugins/plugins/database/database-migrations.md Updates guidance and examples to recommend update() only for plugins; removes destructive command references.
guides/plugins/plugins/content/seo/add-custom-seo-url.md Removes unused updateDestructive() stubs from SEO migration examples.
guides/plugins/plugins/content/mail/add-mail-template.md Removes unused updateDestructive() stub from mail template migration example.
guides/plugins/plugins/checkout/document/add-custom-document.md Removes unused updateDestructive() stub from document migration example.
guides/plugins/plugins/checkout/document/add-custom-document-type.md Removes unused updateDestructive() stubs from document-type related migration examples.
guides/plugins/plugins/checkout/cart/tax-provider.md Removes unused updateDestructive() stub from tax provider migration example.
guides/development/testing/unit/php-unit.md Simplifies the migration unit test sample by removing updateDestructive() invocation.
concepts/framework/migrations.md Aligns the migration concept doc with plugin behavior and clarifies updateDestructive() as core-only usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +171 to +175
| Command | Arguments | Usage |
|:-----------------|:------------------------|:-----------------------------------------------------|
| database:migrate | identifier \(optional\) | Calls the `update()` methods of unhandled migrations |

The identifier argument is used to decide which migrations should be executed. Per default, the identifier is set to run Shopware Core migrations. To run your plugin migrations, set the identifier argument to your plugin's bundle name, in this example `SwagBasicExample`.

```bash
$ ./bin/console database:migrate SwagBasicExample --all
```
The identifier argument decides which migrations should be executed. Per default, the identifier is set to run Shopware Core migrations. To run your plugin migrations, set the identifier argument to your plugin's bundle name, in this example `SwagBasicExample`.
@Isengo1989

Copy link
Copy Markdown
Contributor

Soner (@shyim) so updateDestructive() still works, but we are not recommending it anymore because there is NO usecase/benefit for plugin developers, correct?

Just making sure we are not removing smth that might gives a benefit for some special usecases.

@shyim

Copy link
Copy Markdown
Member Author

Yes. you need to manually invoke bin/console database:migrate-destructive. It's also originally build for core and was never intended for plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants