#3544: Ordering enums with 10+ values
-----------------------------------+----------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  daniel
     Type:  defect                 |      Status:  new   
 Priority:  low                    |   Milestone:        
Component:  trac-admin             |     Version:  0.9.6 
 Severity:  normal                 |    Keywords:        
-----------------------------------+----------------------------------------
 I just attempted to create ten different priority levels:

 {{{
 0 Critical
 1 Highest
 2 Higher
 3 High
 4 Normal
 5 Low
 6 Lower
 7 Lowest
 8 Deferred
 9 Other
 }}}

 I did a bunch of `priority add`, `priority change` and `priority order`
 commands in `trac-admin` to take what we had and approach that list.
 But when I added the tenth value, it always sorted second, no matter how I
 did `priority order`.
 I believe this is because the enum table is:
 {{{
 CREATE TABLE enum (
     type text,
     name text,
     value text,
     UNIQUE (type,name)
 );
 }}}
 The `value` column is what is used for sorting.  It is a text, and as
 text, "10" sorts after "1" but before "2".

 I'd suggest zero-padding the contents of the `value` column.
 (First 001, then 002, etc.)
 This is what I did manually to the sqlite database to get it to work.

-- 
Ticket URL: <http://trac.edgewall.org/ticket/3544>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to