Answer the question
In order to leave comments, you need to log in
How to ensure database consistency when moving between git branches?
There is a project in which database migration is used (and where is it not used? ;)).
Tell me how (with what help) to ensure the correct structure of the test database for any git checkout?
It is clear that the question is not related to migration as such, because it is impossible to do migrate:rollback - some columns may be deleted and they will not be filled with information when returning.
What's the best way to do it?
Answer the question
In order to leave comments, you need to log in
I think the easiest way for you is to use docker/vagrant/i/n, i.e. virtual environment.
You pull a branch, start a virtual machine under it, the base is deployed there, it sits, the necessary migrations are rolled, and you calmly work further. More or less like this.
I advise you to look in this direction.
Otherwise, you will either spend a lot of time on bringing the database to the desired form, or spawn a bunch of databases on the dev-machine for the corresponding branches - which is also a so-so solution.
In the Entity Framework, you can manage migrations and, as a result, version the database.
True, to tie it to an already finished project is a separate song.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question