"rename integrity" on the activity table?

Joel Peshkin bugreport at peshkin.net
Sun Aug 18 04:44:11 UTC 2002


There are a few problems with just leaving the old activity entries when 
the schema changes.  I recognize, though, that it is hard to say how far 
to go with keeping integrity later.

Let's start with the problem that prompted this.   As groupset goeas 
away, it becomes very bad to query on the now non-existant field. 
Search.pm takes everything in fielddefs and makes it searchable, so the 
natural way to get it out of the search form is to kill off the 
fielddefs record.

Unfortunately, this would leave a whole bunch of bugs_activity records 
dangling, not to mention that the activity record would have a suddent 
discontinuity in it where the schema conversion occurred.  So, I 
implemented an update in checksetup.pl that converts the existing 
bugs_activity records to match the new schema and then deletes the 
unused and absent field from fielddefs.  This is fairly easy.

However, this starts an interesting precedent (which would be very 
important to anyone using the activity log to generate reports) where we 
would expect the activity log to accurately reflect the activity even 
across more structural changes.  I think that this is a good thing to do. 
It would be fairly simple to add a RenameFieldVal(fieldname, oldval, 
newval) that could be called for things like 
RenameFieldVal("component","oldname","newname") and fairly simple to get 
all the rename-type code to do properly.

-Joel










More information about the developers mailing list