Dealing with Change history in a database
Before we wind up this chapter, let us touch up 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 record of the changes we made via SQL - for example, 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 are 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 makes 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...