On 8/12/2010 3:20 PM, Piper, Adam wrote:
Hi!

On Wed, Aug 11, 2010 at 12:47 PM, Piper, Adam<adam.pi...@logica.com>
wrote:
There are a number of possible solutions we have discussed, with the
example being wiki pages:

1. Versions<  1

Alter the DELETE to be an UPDATE which decrements the version to the
next available number below 1. Alter the SELECT to take only items
with
versions above 0.
Wouldn't it be easier just to negate ID, not to search for next
available number? Delete can be then just one simple UPDATE statement.
This means that information about deletion status would be stored in
highest ID bit.

I had considered simply negating the number, however when testing this
solution I found that this resulted in collisions if the same version
number is deleted twice:

Versions: 1, 2
Delete latest version: -2, 1
Edit/Save version 1: -2, 1, 2
Delete latest version: -2, 1, -2 (collision)

The SQL I provided in my suggestion was written specifically to avoid
this kind of situation.

What suggest that this could be normalized in another field.

2. "deleted" column, version skipping
Yes. So this is then just a question: should be normalize or should we
not.
For me ID mingling is ugly. It is not conceptually clean concept.
Perhaps the 3rd option is the cleanest, then?


I don't think messing with the version number is the way to go.
See also http://trac.edgewall.org/ticket/9222 and in particular my comment:2.

-- Christian

--
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to