views:

94

answers:

1

As the title of the question states... I've got a database that is using a supercedes model to store information... meaning that each time a customer is edited, instead of updating the row, the software simply slams a new record into the database, and then updates the old records to have a pointer to this new record.

I was trying to draw the 1 <> 1 relationship, but am not sure exactly how to effectively draw this... any tips would be appreciated. Thanks.

A: 

This is a normal 1:1 relationship with the FK pointing to a new record on each update (which is actually an insert and an update). You just need to make sure you insert first and then update the FK reference to the newly inserted record.

Aside, if you do wish to keep old records you should move them to a different table instead of bloating the existing one considering those records are probably obsolete and will rarely need to be accessed other than for auditing.

aleemb
I made the mistake... the relationship is actually going to be a 1:N relationship, because all the old records are being updated with the new ID. I'm going to be experimenting later today with it, but I should be good to go. I've got to stop working late ni...err...early mornings on projects and get some sleep ;)
Richard B