Database Version Control for MySQL

后端 未结 4 1425
别那么骄傲
别那么骄傲 2020-12-19 15:38

What method do you use to version-control your database? I\'ve committed all our database tables as separate .sql scripts to our respository (mercurial). In that way, if any

4条回答
  •  天命终不由人
    2020-12-19 15:54

    I understand the problem but you cannot think of controlling the versions of the databases using git as if it were static code "" since it does not work, in the same way and it is not very useful to generate different files for each programmer since as you say they collide or Well, they do not have traceability, I started a project similar to how you have it, but it was one more huge problem when trying to have control over the versions and the collisions of the programmers, the solution that arrives is to generate a project where the following order is maintained

    • Enter web Login / password
    • Administration of users and profiles of what each user can do
    • Committee area -> the common and current command is sent to the database
    • Example: alter table ALTER TABLE users ADD por2 varchar (255);

    the commit creates a traceability in the control system itself and the structure is sent to git starting from the initial structure for the control of changes

    • Change Control Area: it is the visualization of the commit itself plus the structure generated after the change

    • Server configuration area: the server is configured and a gitlab or github repository is added to it to carry version control in a more visual way without problems for developers

    • Backup restoration area: Send a backup and keep track of each version "Result of the change of the database structure"

    This is the best handling I found without leaving the job to someone specific. I hope it helps you, I believe it in phyton which was the best I found since it uses Django and you save a lot of programming from the administrative part .. Greetings

提交回复
热议问题