So here is a simple (I think) question. I have equipment assigned do maintenance agreements in a database with pricing information etc. However, when a contract comes to term we change the contract the equipment is assigned to - no record is kept of historical contract/equipment assignments.
In the redesign of the database I see a few possible approaches:
1. When the data is changed write it to the historical record table (either when it's input, so the historical table includes all records including the current, or when changed from one contract to another the historical data, pricing etc get put into the historical table, but in both cases the current data stays in the equipment table.
2. Have an intersection table - perhaps with a date field indicating when it was last changed. The most recent becomes the "current" value, while the older records would be considered archives. I could then either just leave it at that, or flag all earlier records with an archive bit to make queries of the data easier.
As I alluded to, handling the date in queries and whatnot would be the potential drawback to just using the intersection table, I know it could be done, but I'd have to do some additional nesting of queries (unless of course I did the archive flag thing). Still, I am leaning in this direction, but ease of use seems to contradict "good database convention," thus the notion of the archive bit which kind of meets in the middle.
Which approach would you think best?
Thanks