[wp-trac] [WordPress Trac] #40357: dbDelta can't change primary keys, create AUTO_INCREMENT columns and doesn't make significant index changes

WordPress Trac noreply at wordpress.org
Fri Jan 30 05:09:49 UTC 2026


#40357: dbDelta can't change primary keys, create AUTO_INCREMENT columns and
doesn't make significant index changes
-------------------------------------------------+-------------------------
 Reporter:  stuporglue                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Database                             |     Version:  4.8
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  refresh                                        |
-------------------------------------------------+-------------------------
Changes (by huzaifaalmesbah):

 * keywords:  has-patch needs-testing needs-unit-tests => has-patch needs-
     unit-tests needs-refresh


Comment:

 I attempted to test the attached patch using:

 {{{
 npm run grunt patch:40357
 }}}

 The patch did not apply cleanly against current `trunk`.

 The following file failed during patching:

  * `wp-admin/includes/upgrade.php`

 Reject file was generated:

  * `wp-admin/includes/upgrade.php.rej`

 Since this patch was created several years ago and `dbDelta()` and related
 database upgrade logic have changed over time, the patch appears to be
 outdated.

 Because of this, removing the `needs-testing` keyword and adding `needs-
 refresh` so the patch can be updated against current core before further
 testing and review can continue.

 A refreshed patch would be needed before meaningful testing can proceed.

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


More information about the wp-trac mailing list