On a old web app I had a table with the following structure:
tools(id, name, abbreviation, width, height, power, type)
The thing is that I need to add history support to the tools. The working scenario is that details of each tool can be modified, and I need to keep track of the changes. For example, if I need to see the details of a tool from a certain date from the past, how can I do that?
How the database have to looks?
I would keep the same table, but add a
dateEffectivefield, and then create a new row every time a tool changes. Then when querying the table, you can get the version of a tool at a given date using:EDIT You may wish to create another field called
toolVersionIdas a primary key.EDIT 2 In response to your comment, how about: