0

At the moment I've got a big Entity Data Model (.edmx) with a database underneath it. Now I want to give people who use my site the option to edit those entities but only after I gave approval of the change.

So this would mean that I want to "change" the entity but not really save it yet, after I accepted the change it would override the enity with the changed one. But when I did this I would still like to be able to rollback the change afterwards.

Now I've come up with a few solutions:

1) Make a entity with like: [ID], [ChangeApplyDate] [ChangeApproveDate] [Entity before change] [Entity after change] [Accepted (boolean)]

2) Make an extra entity with the changed values and a link to the "Original" entity and have a boolean in this entity if it is the current approved one or not. (this would not create a new table but expand the table like, "Book", with a few extra properties.

Now I would like to know how you think about those solutions and if you ever made something like this?

Julian
  • 1,105
  • 2
  • 26
  • 57

1 Answers1

0

There are two things here:

  1. Keep a list of all previous versions. Have a look at my answer to this question: Ideas on database design for capturing audit trails

  2. Controll the acceptance of changes. To do this you could add an approval flag to each table, which only you have access to.

Community
  • 1
  • 1
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • I'll read your link in a moment, but with the second choice I would have multiple versions of the entity in the same table (but with a approval flag) wouldnt that be a huge waste of database space? – Julian Aug 15 '11 at 16:26
  • I looked at the link and that is a genius solution. Thanks alot, this helped me miles! – Julian Aug 15 '11 at 16:30