Version for each field and history date field?

What do you recommend and why?

I have several tables when I make changes to the data ... it should go to the history table (audit) with the effective date.

Another solution is to control the versions of each field to insert a new row when making changes to the data?

What is the best method for account information? Product name and price always change

+5
source share
3 answers

These are slowly changing sizes , type 2and type 4, accordingly.

.

, type 2 ( ) , , , type 4 ( ) , ( ) .

+4

, :
, , , .
:

update table x WHERE somthing something

insert into table x_history 
select * from x WHERE something something

, - .

+2

My personal preference would be to use the observer pattern in your application and implement a separate history table. This means that you can pull data from the history table when you need it, and you do not compromise the speed of the query to the main table.

0
source

All Articles