sql - Versoning in relational database -


i have problem introduce versioning in database design.

let's make easy example. little rental service.

you have table person (p_id, name), table computer (c_id, type) , table rent (r_id, p_id, c_id, fromdata, todata).

i want able change user name, create new version , still have old stuff @ hand if need it.

my goal have kind of system on websites witch makes easy make versioning of records in table.

more information:

i have business logic demands can release record version. have able rollback old ones. reason want exports diffrente versions of data.

you have made statement (that want versioning), not asked question (exactly problem is). without question, it's hard provide answer.

in general, provide versioning by:

  1. identifying entity needs versioned. in case sounds may want versioning "deal" or "rental agreement".

  2. add pk column, version number column, , "originalid" column table @ top of model entity.

  3. to versioning, copy top level record new pk, placing original pk in "originalid" column , incrementing version number column. copy related tables, changing fk in tables match pk of new record. allow user modify records pertaining new-pk version of record.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -