Hi,

There appears to be an issue with how tickets treat milestone values..
Recently in reports (such as "{3} All Tickets by Milestone") , my newly
created tickets started showing up under the heading "Release" rather
than "None".

It looks like an empty string is being inserted in the database TICKET
table as the milestone value, instead of the NULL it should be.


Here's a query from the database showing the issue (note first and last
rows):

select '['||milestone||']' as milestone, count(*) from ticket group by
milestone order by milestone;
 milestone | count
-----------+-------
 []        |     7
 [Beta1.0] |    25
 [Beta1.1] |    19
 [Beta1.2] |    14
 [Beta1.3] |    16
 [Beta1.4] |    11
 [Beta1.5] |    15
 [Beta1.6] |    10
 [Beta1.7] |    13
 [Beta1.8] |    12
           |    95
(11 rows)

I'm using PostgreSQL 8.1.4.  I can fix the data with the following:
UPDATE TICKET SET MILESTONE=NULL WHERE MILESTONE='';

What broke, so that it started doing this? How can I resolve this
permanently?

I suggest there should be foreign key constraints to prevent such
issues from occurring. For example:

  ALTER TABLE ticket ADD FOREIGN KEY (milestone) REFERENCES
milestone(name);

After adding the constraint, creating new tickets fails (as it should):

OperationalError: ERROR:  insert or update on table "ticket" violates
foreign key constraint "ticket_milestone_fkey"
DETAIL:  Key (milestone)=() is not present in table "milestone".


Please help resolving this.

Thanks,
  Viktor


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to