kradmiy/Hello-World-Again — Issue #11: Версирование данных
Author: kradmiy
Created: 2011-10-13 20:54:20+00:00
State: open

http://stackoverflow.com/questions/2751808/how-to-version-control-data-stored-in-mysql

The usual method for "tracking any changes" to a table is to add insert/update/delete trigger procedures on the table and have those records saved in a history table.

For example, if your main data table is "ItemInfo" then you would also have an ItemInfo_History table that got a copy of the new record every time anything changed (via the triggers).

This keeps the performance of your primary table consistent, yet gives you access to the history of any changes if you need it.

Here are some examples, they are for SQL Server but they demonstrate the logic:

My Repository table My Repository History table My Repository Insert trigger procedure My Repository Update trigger procedure