How to implement semantic versioning?

Hello Toaster!
There are tables of data A, B, C etc.. as there are criteria that determine how the semantic version of the data set when the data in A, B, C, etc..

Let's start with an example:
we have a set of data
in table A - "Bob", in table B - "Petey", in table C - "Ahmed". This data version 0.1.0

Changed "Play" to "Peter", the criteria was that we need to increase the patch version.
Now, the state of the database:
in table A - "Bob", in table B - "Peter" in table C - "Ahmed". This data version 0.1.1

Changed "Bob" to "Basil". According to the criteria already minor increase is necessary
Now, the state of the database:
in table A - "Basil", in table B - "Peter" in table C - "Ahmed". This data version 0.2.0

Changed "Ahmed" to "Mohammed". The major criteria to increase need
Now, the state of the database:
in table A - "Basil", in table B - "Peter" in table C - "Mahomed". This data version 1.0.0

What's the problem? now, if you select version, you need to show is relevant to this version of the data, as well as the entire history of changes to this. And yet, if we start will change the previous major version or the last minor patch, it should not affect the history of new versions etc. I think the point is clear.

The problem, like the model, but cannot find literature or to understand how it is being implemented correctly. Who knows?
June 10th 19 at 16:51
3 answers
June 10th 19 at 16:53
Solution
It's not quite right so to do to the database in accordance with izmennymi. This is logically not the right approach. If for example you need to remove izmenenie 0.1.1 but not to touch the other? You know what the name really was Petey, you need to get it back but keep Mohammed? If you rollback you will lose the other entries.

This version control on base usually do in the form of Audit Log (Audit Log) which keep who and when did what what was changed, etc. And then you can make the function to return the change back, or vostanovitj removal, but it is possible to work with each specific case is not straneva other. The magazine can be well and filter it and throw on Tiou actions, users, groups, users, tables etc. I have to find the right action in the log will not be difficult.

If you need stupidly to roll back database to the last state no sense at all to do version 3 of the levels 1.1.1. You can do numbered, or do both version have the point in time. But judging by the fact that you are coming from changes to the data you need an audit log.
Versioning is the same as in the code. If we in older versions changing something that doesn't affect the new versions. - colt_Magg commented on June 10th 19 at 16:56
There are examples of fake, there is actually a version are important. - colt_Magg commented on June 10th 19 at 16:59
June 10th 19 at 16:55
And prescribe seed and committing to the repository.

Read larabel as implemented.

For the structure of the database is Migrations....

And for the snapshots from the database, you have to search/write module at the implementation level... for Example...

If you mean the level of the base.
Look for the implementation of versioning the structure view or using the built-in procedures: for Example... and the Second example...

Wordpress versioning is implemented on a primitive level, and only materials. Also you can watch/analyze.
esteemed, but and did not understand and then seed. He, as I understand it, to fill the initial and test data, and we need to know how the very structure of the database to build and how to use it to support semantic versioning of data :) - colt_Magg commented on June 10th 19 at 16:58
For this, there are migrations... - colt_Magg commented on June 10th 19 at 17:01
Or you need in the opposite direction, with ready base to do snapshots???

Here already search for plugins at the implementation level. For example... - colt_Magg commented on June 10th 19 at 17:04
I don't. You need to maintain versions of datasets. A snapshot of the same is quite another - Miller_Predovic commented on June 10th 19 at 17:07
semantic versioning data - Miller_Predovic commented on June 10th 19 at 17:10
Understand, you mean the base itself.
Look for the implementation of versioning structures using view or stored procedures: ...for Example and the Second example...

Wordpress versioning is implemented on a primitive level, and only materials failed in the second. Also you can watch/analyze. - colt_Magg commented on June 10th 19 at 17:13
June 10th 19 at 16:57
when choosing a version, you need to show is relevant to this version of the data, as well as the entire history of changes to this. And yet, if we start will change the previous major version or the last minor patch, it should not affect the history of new versions etc.

Use git, hg or other version control system.
Data migrations.
so the data stored in the database are changed programmatically. And semantic versioning is not implemented. And the data is for clarity, there is not so simple. - colt_Magg commented on June 10th 19 at 17:00

Find more questions by tags MySQLDatabasesPostgreSQL