So, what I've got so far:
Table: ChangeSets
Columns: Id | Comment | Committer
Table: Customers
Columns: Id | Name
Table: CustomerChangeSets
Columns: Id | CustomerId (FK) | ChangeSetId (FK)
So now I can have multiple customer changes in one changeset (again very much like TFS). Every changeset in a customer object now results in a new customer object being created (and a new Id assigned due to an identity column).
My problem now is, that I don't know how to represent the mapping from and to my customers. I've got several tables that reference to Customers.Id
, but that'd mean I would have a reference to an old version of a customer (the initial one, without any changes).
What's the best way?
Don't create a new customer on each checkin? But how would I get my required logic then?
Update all the foreign keys to my new
Customer.Id
? That'd take quite a long time.