feat: run pending schema migrations from the admin UI - #834
Open
anonymoususer72041 wants to merge 2 commits into
Open
feat: run pending schema migrations from the admin UI#834anonymoususer72041 wants to merge 2 commits into
anonymoususer72041 wants to merge 2 commits into
Conversation
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.
Summary
Adds a dedicated maintenance page (
?m=install&a=maint) reachable through the existing "Maintenance Required" notice, so a logged-in site administrator can bring an already-installed database up to the current schema without leaving the application for the Installation Wizard.modules/install/CATSUI.phpnow handlesa=maint: gates on a logged-in SA session, no-ops when no migrations are pending, and renders the newMaintenance.tpl.modules/install/Maintenance.tplprovides a standalone progress page (CSRF token, lib.js, install.js, install.css) with a Start button and progress bar.modules/install/ajax/maint.phpgains an installed-system auth path: whenINSTALL_BLOCKexists it requires a logged-in SA session and a valid CSRF token; the fresh-installer path is unchanged.js/install.jsadds amaintenanceOnlyflag so the chunkedInstallpage_maintloop redirects toindex.phpon completion and surfaces an error block instead of continuing into installer-only steps (a=reindexResumes, etc.).lib/ModuleUtility.phpcallsSchemaMigrationStatus::clearCache()after each applied install migration and after the NULL-snapshot finalization, so the pending-migration gate re-evaluates on the next request.index.phpexcludes?m=install&a=maintfrom the pending-migration page gate;modules/login/PendingMigrations.tplnow links to that page instead ofinstallwizard.php.Motivation
Since #803, OpenCATS blocks all logged-in, non-public requests while install schema migrations are pending and points admins at the Installation Wizard. For an existing installation that only needs a schema upgrade, the wizard is heavier than necessary: it re-enters the full installer flow (questions, demo data, reindex) and forces the admin out of the application UI. This PR gives admins a focused, in-app path that runs the same chunked migration runner and returns them to the application once the database is current.