Ticket #4778 (closed defect: fixed)

Opened 11 months ago

Last modified 5 months ago

Change enums to varchar

Reported by: ryan Assigned to: anonymous
Priority: high Milestone: 2.5
Component: Administration Version: 2.3
Severity: normal Keywords: schema enum db early
Cc:

Description

Drop enums from the schema in favor of the more portable and flexible varchar. I think we can just change all occurrences of enum in schema.php to varchar(20). This will allow plugins to add new post status values, for example, without having to do an alter table to change the enum.

Attachments

enum_to_varchar.diff (2.4 kB) - added by ryan on 02/05/08 18:07:32.

Change History

08/20/07 11:54:51 changed by westi

+1

This is a really good idea.

08/20/07 14:56:54 changed by Otto42

-1

This is a really bad idea. The whole point of using an enum is to have a fixed set of values that are valid ones. They are stored as integers internally and make things somewhat speedier, since WordPress selects posts based on post_status more or less constantly. Changing it to a varchar would create a not-insignificant performance loss.

If a plugin is making such a radical change as to require its own special post_status values, then it should be able to take the time to alter the table to allow that status.

08/20/07 17:21:10 changed by ryan

Another motivator is to make our SQL more portable. enums aren't.

08/22/07 11:55:20 changed by matt

+1 been meaning to do this for years.

08/29/07 18:05:09 changed by foolswisdom

  • priority changed from normal to high.
  • milestone changed from 2.3 to 2.4 (next).

08/29/07 18:06:03 changed by foolswisdom

Mark and Ryan have decided to postpone this until 2.4, I have marked the priority is high so hopefully it can be done early in 2.4s cycle.

09/30/07 11:34:02 changed by westi

  • keywords changed from schema enum db to schema enum db early.

02/05/08 18:07:32 changed by ryan

  • attachment enum_to_varchar.diff added.

02/05/08 18:07:44 changed by ryan

Change all enums to varchar(20)

02/05/08 21:05:56 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6732]) Enum to varchar. fixes #4778