Is there a version control system for database structure changes?

后端 未结 22 1301
梦毁少年i
梦毁少年i 2020-11-30 17:53

I often run into the following problem.

I work on some changes to a project that require new tables or columns in the database. I make the database modifications and

22条回答
  •  情深已故
    2020-11-30 18:23

    Have your initial create table statements in version controller, then add alter table statements, but never edit files, just more alter files ideally named sequentially, or even as a "change set", so you can find all the changes for a particular deployment.

    The hardiest part that I can see, is tracking dependencies, eg, for a particular deployment table B might need to be updated before table A.

提交回复
热议问题