let's say there is a simple diagram many-to-many
articles, article_tags, tags
It is necessary that every change has loirevalley + ability to undo in 1-3 clicks
field change article, and svyazanykh with her tags.
For example was the entry:
article.title = "hello world1", article.body = "the Text records1", article.published_at = 2016-11-20, article.user_id = 1;
a bunch article_tags (1,1), (1,2) Another user has modified the article and she's already
article.title = "hello world2", article.body = "the Text записи2", article.published_at = 2016-11-20, article.user_id = 3;
a bunch article_tags (1,1), (1,3), (1,4)
Change what You want to log? Database or files? If a file - GIT.
If base, then the migration or perhaps Git+migration.
If the data in the database, the backup of the database (if the database is small, then a backup in GIT).
Jack answered on July 2nd 19 at 13:40
For example, to keep the 2 tables
Before writing to currentItem its contents, a new entry in itemHistory
And to roll back as well
jules_Nolan10 answered on July 2nd 19 at 13:42
This raises the question of data integrity. If you remove one of the related objects that you used in the past - it will be impossible to restore the communication log. And so I'd keep it all in one table with the revision number. That is, each time would duplicate connection when it is modified and written to the global scope, is to fetch this regard.
Melba_Berge answered on July 2nd 19 at 13:44
Maybe it would be easier to put a trigger on update/alter table, which will write the "old" values in a "table of archival values"?