[wp-trac] [WordPress Trac] #34471: dbDelta fails with existing tables and indices

WordPress Trac noreply at wordpress.org
Wed Oct 28 04:44:45 UTC 2015


#34471: dbDelta fails with existing tables and indices
----------------------------+----------------------
 Reporter:  sourcerer-mike  |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Database        |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |     Focuses:
----------------------------+----------------------
Changes (by pento):

 * status:  new => closed
 * version:  4.3.1 =>
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hi there!

 This isn't a valid `CREATE TABLE` statement - the `UNIQUE KEY` line needs
 to be inside the brackets.

 `dbDelta()` also doesn't play nicely with blank lines - see `wp-
 admin/includes/schema.php` for examples of how to write
 `dbDelta()`-friendly table definitions.

 `dbDelta()` is not intended to parse all possible table definitions, just
 the subset needed for WordPress tables. While we're open to expanding what
 it supports, of course, for standard table definitions, you need to adhere
 to the formats it supports.

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


More information about the wp-trac mailing list