Dealing with change history in a database
Before we wind up this chapter, let us touch on the change history tables as well. Change histories on issues hold important information on what was changed and when. It is sometimes very useful for reporting and, sometimes, we find ourselves manually adding change histories in the database to keep a record of the changes we made via SQL—such as updating the status of an issue via SQL as we saw earlier in this chapter.
A set of changes happening on an issue at a single point of time is grouped together to form a change group. There is an entry for each such change group in the changegroup
table, with the information about the issue on which the change is made, the user who made the change, and the time at which the changes happened.
Then, there is an entry for each of those individual changes in the changeitem
table, all pointing to the respective
changegroup
. The
changeitem
table holds information on what was actually changed—the old value and...