I was looking to have a ticket report that was ordered by status, but with an 
arbitrary ordering of the status groups ("Open", then "Fixed", then "Deferred", 
then ...).  No problem  I'll just use SQLite CLI to create my own enum table 
with the statuses, and a display order for each, then join ticket with enumand 
order the result set by enum.display_order.

Apparently, I was wrong.  I was able to create and populate the enum table 
(actually, "swff_enum") no problem (see CREATE below).  But I get an error from 
Fossil trying to save the report (report SQL below).

Syntax error: access to swff_enum.TYPE is prohibited

Certainly, I missed something somewhere.  Can anyone enlighten me?  Has this 
been discussed before?

Thanks!

 -Clark


CREATE TABLE swff_enum (
  TYPE text,
  NAME text,
  DISPLAY_ORDER integer
)

SELECT
  CASE WHEN t.status IN ('Open','Verified') THEN '#f2dcdc'
       WHEN t.status='Review' THEN '#e8e8e8'
       WHEN t.status='Fixed' THEN '#cfe8bd'
       WHEN t.status='Tested' THEN '#bde5d6'
       WHEN t.status='Deferred' THEN '#cacae5'
       ELSE '#c8c8c8' END AS 'bgcolor',
  t.tkt_id AS "Tkt ID",
  substr(t.tkt_uuid,1,10) AS "#",
  t.status as Status,
  t.priority as Priority,
  datetime(t.tkt_mtime) AS Modified,
  t.type as Type,
  t.subsystem as Developer,
  t.title as Title
FROM
  ticket t,
  swff_enum m
where
  m.type = 'status'
  and m.name = t.status
--where status not in ('Closed','Deferred')
ORDER BY
m.display_order, priority, Modified desc

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to