[PR #2033] [MERGED] fix: plugin migration rollback and cache clearing on uninstall #1721

Closed
opened 2026-02-05 18:22:39 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pelican-dev/panel/pull/2033
Author: @PalmarHealer
Created: 12/21/2025
Status: Merged
Merged: 1/4/2026
Merged by: @Boy132

Base: mainHead: palmarhealer/fix-plugin-migration


📝 Commits (5)

  • c4d101c fix: replace migrate:rollback with migrate:reset and clear cached components after plugin updates
  • d435c6b replace Artisan calls with direct usage of Migrator and Seeder for improved error handling and code clarity
  • c171d36 remove redundant optimize:clear Artisan call from PluginService
  • 6f1f888 Merge branch 'main' into palmarhealer/fix-plugin-migration
  • c8e6f71 small cleanup

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 app/Services/Helpers/PluginService.php (+6 -1)

📄 Description

Fixes two critical bugs in the plugin uninstallation process that caused incomplete migration rollback and cache-related errors.

  1. The rollbackPluginMigrations() method used migrate:rollback, which only rolls back the last batch of migrations. If a plugin had migrations run across multiple batches (e.g., initial install in batch 50, update adds migration in batch 75), only the most recent batch was rolled back, leaving orphaned tables and columns in the database.

  2. After uninstalling a plugin, users encountered "Table not found" errors (e.g., SQLSTATE[42S02]: Base table or view not found).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pelican-dev/panel/pull/2033 **Author:** [@PalmarHealer](https://github.com/PalmarHealer) **Created:** 12/21/2025 **Status:** ✅ Merged **Merged:** 1/4/2026 **Merged by:** [@Boy132](https://github.com/Boy132) **Base:** `main` ← **Head:** `palmarhealer/fix-plugin-migration` --- ### 📝 Commits (5) - [`c4d101c`](https://github.com/pelican-dev/panel/commit/c4d101cfe47af423fe79a874031aacb9d83a6ca7) fix: replace `migrate:rollback` with `migrate:reset` and clear cached components after plugin updates - [`d435c6b`](https://github.com/pelican-dev/panel/commit/d435c6b924f0c255c7c7f344dfef6e0d3681ca89) replace Artisan calls with direct usage of `Migrator` and `Seeder` for improved error handling and code clarity - [`c171d36`](https://github.com/pelican-dev/panel/commit/c171d36248f94977e537593c0235c6a94b56f21b) remove redundant `optimize:clear` Artisan call from `PluginService` - [`6f1f888`](https://github.com/pelican-dev/panel/commit/6f1f888913fac1efe8f64db5eaa8978817252a46) Merge branch 'main' into palmarhealer/fix-plugin-migration - [`c8e6f71`](https://github.com/pelican-dev/panel/commit/c8e6f711c0ef401cb9b56bea26d635e73e47009d) small cleanup ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `app/Services/Helpers/PluginService.php` (+6 -1) </details> ### 📄 Description Fixes two critical bugs in the plugin uninstallation process that caused incomplete migration rollback and cache-related errors. 1. The `rollbackPluginMigrations()` method used `migrate:rollback`, which only rolls back the **last batch** of migrations. If a plugin had migrations run across multiple batches (e.g., initial install in batch 50, update adds migration in batch 75), only the most recent batch was rolled back, leaving orphaned tables and columns in the database. 2. After uninstalling a plugin, users encountered "Table not found" errors (e.g., `SQLSTATE[42S02]: Base table or view not found`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 18:22:39 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel-pelican-dev#1721