#3544 closed defect (duplicate)
Ordering enums with 10+ values
Reported by: | Owned by: | daniel | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | admin/console | Version: | 0.9.6 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
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.
Attachments (0)
Change History (2)
follow-up: 2 comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Probable duplicate of #3382.