How do you manage databases in development, test, and production?

前端 未结 14 2053
情书的邮戳
情书的邮戳 2020-11-30 16:23

I\'ve had a hard time trying to find good examples of how to manage database schemas and data between development, test, and production servers.

Here\'s our setup. E

14条回答
  •  既然无缘
    2020-11-30 17:04

    The book Refactoring Databases: Evolutionary Database Design might give you some ideas on how to manage the database. A short version is readable also at http://martinfowler.com/articles/evodb.html

    In one PHP+MySQL project I've had the database revision number stored in the database, and when the program connects to the database, it will first check the revision. If the program requires a different revision, it will open a page for upgrading the database. Each upgrade is specified in PHP code, which will change the database schema and migrate all existing data.

提交回复
热议问题