[wp-trac] [WordPress Trac] #10404: dbDelta creates duplicate indexes when index definition contains spaces
WordPress Trac
noreply at wordpress.org
Wed Feb 27 16:01:53 UTC 2013
#10404: dbDelta creates duplicate indexes when index definition contains spaces
-------------------------------+-----------------------------
Reporter: Denis-de-Bernardy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Database | Version: 2.8.1
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------------+-----------------------------
Comment (by charlestonsw):
Replying to [comment:6 RonStrilaeff]:
> ... and the only way I could prevent it from creating post_id_2, 3, 4,
(and user_id_2, 3, 4), etc was to add the "IF NOT EXISTS" clause to the
CREATE TABLE statement (as in my snippet above).
How does dbDelta handle the "IF NOT EXISTS" when the data structure
changes, for example adding a column during a plugin update? Standard
SQL would not add the column because the table exists.
That could be a bad side effect of the workaround.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10404#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list