[wp-trac] [WordPress Trac] #22023: Remove UNIQUE for slug in wp_terms
WordPress Trac
noreply at wordpress.org
Sat Jun 14 10:21:57 UTC 2014
#22023: Remove UNIQUE for slug in wp_terms
---------------------------------+------------------
Reporter: nacin | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Taxonomy | Version: 2.3
Severity: normal | Resolution:
Keywords: has-patch 4.0-early | Focuses:
---------------------------------+------------------
Comment (by simonwheatley):
Replying to [comment:31 ircbot]:
> ''This ticket was mentioned in IRC in #wordpress-dev by simonwheatley.
[http://irclogs.wordpress.org/chanlog.php?channel=wordpress-
dev&day=2014-06-12&sort=asc#m868539 View the logs].''
> @nacin – "I don't think the current API in any way allows for multiple
duplicate term slugs to sneak in the database, except possibly by race
condition. which I am concerned about."
I've been thinking about Nacin's concerns above, and AFAIK it's not
possible to have a `UNIQUE` constraint across the `wp_term` and
`wp_term_taxonomy` tables. If this (race conditions allowing duplicate
terms) is a big enough concern to block this ticket, and we need to block
the possibility of duplicate terms with a constraint at the database
level, then one alternative is to lose the `wp_terms` table
([http://make.wordpress.org/core/2013/07/28/potential-roadmap-for-
taxonomy-meta-and-post-relationships/ as mentioned in the potential
taxonomy roadmap]) so we can have a `UNIQUE` constraint in the
restructured `wp_term_taxonomy` on `taxonomy` and `slug` (and `name`,
perhaps). This is obviously (somewhat understating things) a big change…
but we're considering some other structure changes, so ''may be'' a good
time to get it in? I imagine we'd also want to have time and resource to
test both core and existing plugins?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22023#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list