[wp-trac] [WordPress Trac] #36887: Database upgrades should fail gracefully

WordPress Trac noreply at wordpress.org
Fri Sep 12 10:16:07 UTC 2025


#36887: Database upgrades should fail gracefully
-----------------------------+-----------------------------
 Reporter:  pento            |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  low              |   Milestone:  Future Release
Component:  Upgrade/Install  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:  administration
-----------------------------+-----------------------------

Comment (by jdeep):

 I am planning to work on this ticket. I had a few questions regarding the
 fix.

 1. Should the fix use explicit validation after every upgrade_xxx()
 function to verify that the expected schema changes were applied?

 2. Do we want to log detailed debug information (e.g., failed SQL
 statement, stack trace) to a log file, or keep the error message shown to
 the user minimal for security reasons?

 3. Should the process halt immediately on the first failure, or should it
 attempt to run all steps (can cause cascading errors) and report a summary
 of all failures at the end?

 My thought process is, having a Higher Order Function like
 `safe_upgrade()` which will call one of the upgrade functions and log
 errors if there are any.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/36887#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list