How do you maintain revision control of your database structure?

前端 未结 5 1742
栀梦
栀梦 2021-01-16 14:12

What is the simplest way of keeping track of changes to a projects database structure?

When I change something about the database (eg, add a new table, add a new fie

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-16 14:31

    In my company each developer is encouraged to save all db sctructure changes to a script files in the folder containing module's revision number. These scripts are kept in svn repository.

    When application starts, the db upgrade code compares current db version and code version and if the code is newer - looks into scripts folder and applies all db changes automatically.

    This way every instance of application (on production or developers machines) always upgrades db to their code version and it works great.

    Of course, some automation could be added - if we find a suitable tool.

提交回复
热议问题