[wp-trac] [WordPress Trac] #55942: Add a "type" field to the meta and options tables

WordPress Trac noreply at wordpress.org
Thu Jul 7 11:27:49 UTC 2022


#55942: Add a "type" field to the meta and options tables
-------------------------+---------------------
 Reporter:  azaozz       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  6.1
Component:  Database     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+---------------------

Comment (by barry.hughes):

 Also a little on the fence, though I think I'm still leaning toward enums
 (memory efficient, good query readability, stricter than a plain integer).

 > In addition to the defined values there always are '' (mapped to 0) and
 NULL. That may be somewhat confusing.

 I think one part of this can be avoided completely, by making the column
 non-nullable.

 > On the other hand using TINYINT and keeping the mapping outside of the
 DB gives us full control, even plugins would be able to add to that
 mapping, eventually.

 This is an interesting question, since if we want plugins to be able to
 add to the mapping we also need to build up systems around that to help
 avoid collisions, etc (and that leads me to think that perhaps neither
 TINYINT nor ENUM would be a good fit).

 Though ... I'm a little unsure if we actually *do* want plugins to be able
 to interact at this level (or, indeed, if there are plugin developers that
 see potential value in being able to do so) 🤔

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


More information about the wp-trac mailing list